summaryrefslogtreecommitdiffstats
path: root/test/conductor/test_conductor_calls.py
diff options
context:
space:
mode:
authorkrishnaa96 <krishna.moorthy6@wipro.com>2020-03-10 10:55:13 +0530
committerkrishnaa96 <krishna.moorthy6@wipro.com>2020-03-20 20:39:59 +0530
commitf30da9513ae0501f453ee93729b381270fad0a2b (patch)
treea3ab005e2f16bfe8709bdcfbab6d28b5c6760a19 /test/conductor/test_conductor_calls.py
parent420f4b3a4ca25d5de5c9318b2ca89e1ef126b278 (diff)
Add generic conductor interface
Issue-ID: OPTFRA-715 Signed-off-by: krishnaa96 <krishna.moorthy6@wipro.com> Change-Id: I84218ab65e645a90d2ff1c365bdde1e06ab27d2e
Diffstat (limited to 'test/conductor/test_conductor_calls.py')
-rw-r--r--test/conductor/test_conductor_calls.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/test/conductor/test_conductor_calls.py b/test/conductor/test_conductor_calls.py
index 52e0367..0042ecb 100644
--- a/test/conductor/test_conductor_calls.py
+++ b/test/conductor/test_conductor_calls.py
@@ -1,5 +1,6 @@
# -------------------------------------------------------------------------
# Copyright (c) 2018 AT&T Intellectual Property
+# Copyright (C) 2020 Wipro Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -17,7 +18,7 @@
#
import unittest
-from apps.placement.optimizers.conductor import conductor
+from osdf.adapters.conductor import conductor
import osdf.config.loader as config_loader
from osdf.utils.interfaces import json_from_file
from osdf.utils.programming_utils import DotDict
@@ -41,12 +42,20 @@ class TestConductorCalls(unittest.TestCase):
def test_request(self):
req_json = json_from_file("./test/placement-tests/request.json")
policies = pol.get_local_policies("test/policy-local-files/", self.lp)
- conductor.request(req_json, self.osdf_config, policies)
+ req_info = req_json['requestInfo']
+ demands = req_json['placementInfo']['placementDemands']
+ request_parameters = req_json['placementInfo']['requestParameters']
+ service_info = req_json['serviceInfo']
+ conductor.request(req_info, demands, request_parameters, service_info, self.osdf_config, policies)
def test_request_vfmod(self):
req_json = json_from_file("./test/placement-tests/request_vfmod.json")
policies = pol.get_local_policies("test/policy-local-files/", self.lp)
- conductor.request(req_json, self.osdf_config, policies)
+ req_info = req_json['requestInfo']
+ demands = req_json['placementInfo']['placementDemands']
+ request_parameters = req_json['placementInfo']['requestParameters']
+ service_info = req_json['serviceInfo']
+ conductor.request(req_info, demands, request_parameters, service_info, self.osdf_config, policies)
if __name__ == "__main__":