Test ELB by creating a LB rule
(self)
| 998 | |
| 999 | @attr(tags=["eip"]) |
| 1000 | def test_01_elb_create(self): |
| 1001 | """Test ELB by creating a LB rule |
| 1002 | """ |
| 1003 | |
| 1004 | # Validate the following |
| 1005 | # 1. Deploy 2 instances |
| 1006 | # 2. Create LB rule to port 22 for the VMs and try to access VMs with |
| 1007 | # EIP:port. Make sure that ingress rule is created to allow access |
| 1008 | # with universal CIDR (0.0.0.0/0) |
| 1009 | # 3. For LB rule IP user_ip_address.is_system=1 |
| 1010 | # 4. check configuration changes for EIP reflects on NS |
| 1011 | # commands to verify on NS : |
| 1012 | # * "show ip" |
| 1013 | # * "show lb vserer"-make sure that output says they are all up |
| 1014 | # and running and USNIP : ON |
| 1015 | |
| 1016 | # Verify listSecurity groups response |
| 1017 | security_groups = SecurityGroup.list( |
| 1018 | self.apiclient, |
| 1019 | account=self.account.name, |
| 1020 | domainid=self.account.domainid |
| 1021 | ) |
| 1022 | self.assertEqual( |
| 1023 | isinstance(security_groups, list), |
| 1024 | True, |
| 1025 | "Check for list security groups response" |
| 1026 | ) |
| 1027 | self.assertEqual( |
| 1028 | len(security_groups), |
| 1029 | 1, |
| 1030 | "Check List Security groups response" |
| 1031 | ) |
| 1032 | self.debug("List Security groups response: %s" % |
| 1033 | str(security_groups)) |
| 1034 | |
| 1035 | security_group = security_groups[0] |
| 1036 | |
| 1037 | self.debug( |
| 1038 | "Creating Ingress rule to allow SSH on default security group") |
| 1039 | |
| 1040 | cmd = authorizeSecurityGroupIngress.authorizeSecurityGroupIngressCmd() |
| 1041 | cmd.domainid = self.account.domainid |
| 1042 | cmd.account = self.account.name |
| 1043 | cmd.securitygroupid = security_group.id |
| 1044 | cmd.protocol = 'TCP' |
| 1045 | cmd.startport = 22 |
| 1046 | cmd.endport = 22 |
| 1047 | cmd.cidrlist = '0.0.0.0/0' |
| 1048 | self.apiclient.authorizeSecurityGroupIngress(cmd) |
| 1049 | |
| 1050 | self.debug( |
| 1051 | "Fetching LB IP for account: %s" % self.account.name) |
| 1052 | ip_addrs = PublicIPAddress.list( |
| 1053 | self.api_client, |
| 1054 | associatednetworkid=self.guest_network.id, |
| 1055 | account=self.account.name, |
| 1056 | domainid=self.account.domainid, |
| 1057 | forloadbalancing=True, |
nothing calls this directly
no test coverage detected