return compute_nodes
-def open_icmp_ssh(neutron_client, security_group_id):
- os_utils.create_secgroup_rule(neutron_client,
- security_group_id,
- 'ingress',
- 'icmp')
- os_utils.create_secgroup_rule(neutron_client,
- security_group_id,
- 'tcp',
- 80, 80)
+def open_icmp(neutron_client, security_group_id):
+ if os_utils.check_security_group_rules(neutron_client,
+ security_group_id,
+ 'ingress',
+ 'icmp'):
+
+ if not os_utils.create_secgroup_rule(neutron_client,
+ security_group_id,
+ 'ingress',
+ 'icmp'):
+ logger.error("Failed to create icmp security group rule...")
+ else:
+ logger.info("This rule exists for security group: %s"
+ % security_group_id)
+
+
+def open_http_port(neutron_client, security_group_id):
+ if os_utils.check_security_group_rules(neutron_client,
+ security_group_id,
+ 'ingress',
+ 'tcp',
+ 80, 80):
+
+ if not os_utils.create_secgroup_rule(neutron_client,
+ security_group_id,
+ 'ingress',
+ 'tcp',
+ 80, 80):
+
+ logger.error("Failed to create http security group rule...")
+ else:
+ logger.info("This rule exists for security group: %s"
+ % security_group_id)
def open_bgp_port(neutron_client, security_group_id):
- os_utils.create_secgroup_rule(neutron_client,
- security_group_id,
- 'tcp',
- 179, 179)
+ if os_utils.check_security_group_rules(neutron_client,
+ security_group_id,
+ 'ingress',
+ 'tcp',
+ 179, 179):
+
+ if not os_utils.create_secgroup_rule(neutron_client,
+ security_group_id,
+ 'ingress',
+ 'tcp',
+ 179, 179):
+ logger.error("Failed to create bgp security group rule...")
+ else:
+ logger.info("This rule exists for security group: %s"
+ % security_group_id)
def exec_cmd(cmd, verbose):
if "running" in
node.run_cmd("sudo systemctl status opendaylight")]
computes = [node for node in openstack_nodes if node.is_compute()]
+
msg = ("Verify that OpenDaylight can start/communicate with zrpcd/Quagga")
results.record_action(msg)
results.add_to_summary(0, "-")
sg_id = os_utils.create_security_group_full(neutron_client,
TESTCASE_CONFIG.secgroup_name,
TESTCASE_CONFIG.secgroup_descr)
- test_utils.open_icmp_ssh(neutron_client, sg_id)
+ test_utils.open_icmp(neutron_client, sg_id)
+ test_utils.open_http_port(neutron_client, sg_id)
+
test_utils.open_bgp_port(neutron_client, sg_id)
net_id, _, _ = test_utils.create_network(neutron_client,
TESTCASE_CONFIG.net_1_name,
sg_id = os_utils.create_security_group_full(neutron_client,
TESTCASE_CONFIG.secgroup_name,
TESTCASE_CONFIG.secgroup_descr)
- test_utils.open_icmp_ssh(neutron_client, sg_id)
+ test_utils.open_icmp(neutron_client, sg_id)
+ test_utils.open_http_port(neutron_client, sg_id)
+
vm_2 = test_utils.create_instance(
nova_client,
TESTCASE_CONFIG.instance_2_name,
sg_id = os_utils.create_security_group_full(neutron_client,
TESTCASE_CONFIG.secgroup_name,
TESTCASE_CONFIG.secgroup_descr)
- test_utils.open_icmp_ssh(neutron_client, sg_id)
+ test_utils.open_icmp(neutron_client, sg_id)
+ test_utils.open_http_port(neutron_client, sg_id)
+
vm_2 = test_utils.create_instance(
nova_client,
TESTCASE_CONFIG.instance_2_name,