diff options
8 files changed, 84 insertions, 19 deletions
diff --git a/ansible/roles/configure_rabbitmq/tasks/main.yml b/ansible/roles/configure_rabbitmq/tasks/main.yml index 3ad60c1ea..4ff4222dc 100644 --- a/ansible/roles/configure_rabbitmq/tasks/main.yml +++ b/ansible/roles/configure_rabbitmq/tasks/main.yml @@ -12,6 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. --- +- name: Create rabbitmq configuration + template: + src: rabbitmq.config.j2 + dest: /etc/rabbitmq/rabbitmq.config + +- name: Define user definitions file + template: + src: user_definitions.json.j2 + dest: /etc/rabbitmq/definitions.json + - name: Restart rabbitmq service: name: rabbitmq-server @@ -20,11 +30,5 @@ - name: rabbitmqctl start_app shell: rabbitmqctl start_app -- name: Configure rabbitmq - rabbitmq_user: - user: yardstick - password: yardstick - configure_priv: .* - read_priv: .* - write_priv: .* - state: present +- name: Enable management plugin + shell: rabbitmq-plugins enable rabbitmq_management diff --git a/ansible/roles/configure_rabbitmq/templates/rabbitmq.config.j2 b/ansible/roles/configure_rabbitmq/templates/rabbitmq.config.j2 new file mode 100644 index 000000000..8f07edf5c --- /dev/null +++ b/ansible/roles/configure_rabbitmq/templates/rabbitmq.config.j2 @@ -0,0 +1,5 @@ + [
+ {rabbitmq_management, [
+ {load_definitions, "/etc/rabbitmq/definitions.json"}
+ ]}
+].
\ No newline at end of file diff --git a/ansible/roles/configure_rabbitmq/templates/user_definitions.json.j2 b/ansible/roles/configure_rabbitmq/templates/user_definitions.json.j2 new file mode 100644 index 000000000..831675ff1 --- /dev/null +++ b/ansible/roles/configure_rabbitmq/templates/user_definitions.json.j2 @@ -0,0 +1,23 @@ + {
+ "users": [{
+ "name": "yardstick",
+ "password_hash": "{{ }}",
+ "hashing_algorithm": "rabbit_password_hashing_sha256",
+ "tags": ""
+ }],
+ "vhosts": [{
+ "name": "/"
+ }],
+ "permissions": [{
+ "user": "yardstick",
+ "vhost": "/",
+ "configure": ".*",
+ "write": ".*",
+ "read": ".*"
+ }],
+ "parameters": [],
+ "policies": [],
+ "queues": [],
+ "exchanges": [],
+ "bindings": []
+}
diff --git a/samples/vnf_samples/nsut/prox/configs/gen_acl-2.cfg b/samples/vnf_samples/nsut/prox/configs/gen_acl-2.cfg index 816bb3297..bf49cd484 100644 --- a/samples/vnf_samples/nsut/prox/configs/gen_acl-2.cfg +++ b/samples/vnf_samples/nsut/prox/configs/gen_acl-2.cfg @@ -38,7 +38,7 @@ $qinq_tag_inline="88 a8" [global] start time=5 -name=Basic Gen +name=Basic ACL Gen x2 [core 0] mode=master @@ -50,7 +50,7 @@ mode=gen tx port=p0 bps=625000000 ; Ethernet + QinQ + IP + UDP -pkt inline=${sut_mac0} 70 00 00 00 00 01 ${qinq_tag_inline} 00 01 81 00 00 01 08 00 45 00 00 1c 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 00 35 00 35 00 08 7c 21 FFFFFFFF +pkt inline=${sut_mac0} 70 00 00 00 00 01 ${qinq_tag_inline} 00 01 81 00 00 01 08 00 45 00 00 20 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 00 35 00 35 00 0c 7c 21 50 51 52 53 ; svlan: [0,1] random=000000000000000X rand_offset=14 @@ -72,7 +72,6 @@ random=000000000000XXX00000000XXXXXXXXX rand_offset=42 lat pos=50 - [core 2] name=p1 task=0 @@ -80,7 +79,7 @@ mode=gen tx port=p1 bps=625000000 ; Ethernet + QinQ + IP + UDP -pkt inline=${sut_mac1} 70 00 00 00 00 02 ${qinq_tag_inline} 00 01 81 00 00 01 08 00 45 00 00 1c 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 00 35 00 35 00 08 7c 21 FFFFFFFF +pkt inline=${sut_mac1} 70 00 00 00 00 02 ${qinq_tag_inline} 00 01 81 00 00 01 08 00 45 00 00 20 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 00 35 00 35 00 0c 7c 21 50 51 52 53 ; svlan: [0,1] random=000000000000000X rand_offset=14 @@ -107,10 +106,12 @@ name=rec 0 task=0 mode=lat rx port=p0 +lat pos=50 [core 4] name=rec 1 task=0 mode=lat rx port=p1 +lat pos=50 diff --git a/samples/vnf_samples/nsut/prox/configs/gen_acl-4.cfg b/samples/vnf_samples/nsut/prox/configs/gen_acl-4.cfg index bcfdb5028..6c5939356 100644 --- a/samples/vnf_samples/nsut/prox/configs/gen_acl-4.cfg +++ b/samples/vnf_samples/nsut/prox/configs/gen_acl-4.cfg @@ -62,7 +62,7 @@ mode=gen tx port=p0 bps=625000000 ; Ethernet + QinQ + IP + UDP -pkt inline=${sut_mac0} 70 00 00 00 00 01 ${qinq_tag_inline} 00 01 81 00 00 01 08 00 45 00 00 1c 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 00 35 00 35 00 08 7c 21 FFFFFFFF +pkt inline=${sut_mac0} 70 00 00 00 00 01 ${qinq_tag_inline} 00 01 81 00 00 01 08 00 45 00 00 20 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 00 35 00 35 00 0c 7c 21 50 51 52 53 ; svlan: [0,1] random=000000000000000X rand_offset=14 @@ -82,6 +82,7 @@ rand_offset=23 ; dport: [0..511] random=000000000000XXX00000000XXXXXXXXX rand_offset=42 +lat pos=50 [core 2] name=p1 @@ -90,7 +91,7 @@ mode=gen tx port=p1 bps=625000000 ; Ethernet + QinQ + IP + UDP -pkt inline=${sut_mac1} 70 00 00 00 00 02 ${qinq_tag_inline} 00 01 81 00 00 01 08 00 45 00 00 1c 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 00 35 00 35 00 08 7c 21 FFFFFFFF +pkt inline=${sut_mac1} 70 00 00 00 00 02 ${qinq_tag_inline} 00 01 81 00 00 01 08 00 45 00 00 20 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 00 35 00 35 00 0c 7c 21 50 51 52 53 ; svlan: [0,1] random=000000000000000X rand_offset=14 @@ -110,6 +111,7 @@ rand_offset=23 ; dport: [0..511] random=000000000000XXX00000000XXXXXXXXX rand_offset=42 +lat pos=50 [core 3] name=p2 @@ -118,7 +120,7 @@ mode=gen tx port=p2 bps=625000000 ; Ethernet + QinQ + IP + UDP -pkt inline=${sut_mac2} 70 00 00 00 00 02 ${qinq_tag_inline} 00 01 81 00 00 01 08 00 45 00 00 1c 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 00 35 00 35 00 08 7c 21 FFFFFFFF +pkt inline=${sut_mac2} 70 00 00 00 00 03 ${qinq_tag_inline} 00 01 81 00 00 01 08 00 45 00 00 20 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 00 35 00 35 00 0c 7c 21 50 51 52 53 ; svlan: [0,1] random=000000000000000X rand_offset=14 @@ -138,6 +140,7 @@ rand_offset=23 ; dport: [0..511] random=000000000000XXX00000000XXXXXXXXX rand_offset=42 +lat pos=50 [core 4] name=p3 @@ -146,7 +149,7 @@ mode=gen tx port=p3 bps=625000000 ; Ethernet + QinQ + IP + UDP -pkt inline=${sut_mac3} 70 00 00 00 00 04 ${qinq_tag_inline} 00 01 81 00 00 01 08 00 45 00 00 1c 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 00 35 00 35 00 08 7c 21 FFFFFFFF +pkt inline=${sut_mac3} 70 00 00 00 00 04 ${qinq_tag_inline} 00 01 81 00 00 01 08 00 45 00 00 20 00 01 00 00 40 11 f7 7d c0 a8 01 01 c0 a8 01 01 00 35 00 35 00 0c 7c 21 50 51 52 53 ; svlan: [0,1] random=000000000000000X rand_offset=14 @@ -166,27 +169,33 @@ rand_offset=23 ; dport: [0..511] random=000000000000XXX00000000XXXXXXXXX rand_offset=42 +lat pos=50 [core 5] name=rec 0 task=0 mode=lat rx port=p0 +lat pos=50 [core 6] name=rec 1 task=0 mode=lat rx port=p1 +lat pos=50 [core 7] name=rec 2 task=0 mode=lat rx port=p2 +lat pos=50 [core 8] name=rec 3 task=0 mode=lat rx port=p3 +lat pos=50 + diff --git a/samples/vnf_samples/nsut/vepc/tc_epc_default_bearer_create_landslide.yaml b/samples/vnf_samples/nsut/vepc/tc_epc_default_bearer_create_landslide.yaml index 0b94d313f..ee17df138 100644 --- a/samples/vnf_samples/nsut/vepc/tc_epc_default_bearer_create_landslide.yaml +++ b/samples/vnf_samples/nsut/vepc/tc_epc_default_bearer_create_landslide.yaml @@ -27,6 +27,7 @@ scenarios: tg__0: tg__0.traffic_gen vnf__0: vnf__0.vnf_epc options: + traffic_duration: 70 dmf: transactionRate: 5 packetSize: 512 diff --git a/yardstick/network_services/vnf_generic/vnf/tg_landslide.py b/yardstick/network_services/vnf_generic/vnf/tg_landslide.py index a146b72ca..157568618 100644 --- a/yardstick/network_services/vnf_generic/vnf/tg_landslide.py +++ b/yardstick/network_services/vnf_generic/vnf/tg_landslide.py @@ -600,6 +600,13 @@ class LandslideResourceHelper(sample_vnf.ClientResourceHelper): def create_test_session(self, test_session): # Use tcl client to create session test_session['library'] = self._user_id + + # If no traffic duration set in test case, use predefined default value + # in session profile + test_session['duration'] = self.scenario_helper.all_options.get( + 'traffic_duration', + test_session['duration']) + LOG.debug("Creating session='%s'", test_session['name']) self._tcl.create_test_session(test_session) diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_landslide.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_landslide.py index 53439972a..15f7b36c7 100644 --- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_landslide.py +++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_landslide.py @@ -337,6 +337,7 @@ class TestLandslideTrafficGen(unittest.TestCase): 'traffic_profile': '../../traffic_profiles/landslide/' 'landslide_dmf_udp.yaml', 'options': { + 'traffic_duration': 71, 'test_cases': [ { 'BearerAddrPool': '2002::2', @@ -1178,10 +1179,24 @@ class TestLandslideResourceHelper(unittest.TestCase): def test_create_test_session_res_helper(self, *args): self.res_helper._user_id = self.SUCCESS_RECORD_ID self.res_helper._tcl = mock.Mock() - test_session = {'name': 'test'} - self.assertIsNone(self.res_helper.create_test_session(test_session)) + self.res_helper.scenario_helper.all_options = {'traffic_duration': 71} + _session = {'name': 'test', 'duration': 60} + self.assertIsNone(self.res_helper.create_test_session(_session)) self.res_helper._tcl.create_test_session.assert_called_once_with( - {'name': 'test', 'library': self.SUCCESS_RECORD_ID}) + {'name': _session['name'], + 'duration': 71, + 'library': self.SUCCESS_RECORD_ID}) + + def test_create_test_session_res_helper_no_traffic_duration(self, *args): + self.res_helper._user_id = self.SUCCESS_RECORD_ID + self.res_helper._tcl = mock.Mock() + self.res_helper.scenario_helper.all_options = {} + _session = {'name': 'test', 'duration': 60} + self.assertIsNone(self.res_helper.create_test_session(_session)) + self.res_helper._tcl.create_test_session.assert_called_once_with( + {'name': _session['name'], + 'duration': 60, + 'library': self.SUCCESS_RECORD_ID}) @mock.patch.object(tg_landslide.LandslideTclClient, 'resolve_test_server_name', |