summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-04-05 06:47:24 +0000
committerGerrit Code Review <review@openstack.org>2017-04-05 06:47:24 +0000
commit15abac97d7783ca30067eb93ccfb20e1f07ced36 (patch)
tree9fa8d37b518e70a9e96947aeb7960f35f7711550
parent7704d6ebb585a43d72a67d9f18e8afdf279aeef4 (diff)
parentb38cd9fe1a60fe905259d227e1e7481756d00fb7 (diff)
Merge "Improvment for scale test"
-rw-r--r--fuelweb_test/tests/tests_scale/test_scale_group_2.py86
1 files changed, 49 insertions, 37 deletions
diff --git a/fuelweb_test/tests/tests_scale/test_scale_group_2.py b/fuelweb_test/tests/tests_scale/test_scale_group_2.py
index 9eeb277..cd8deb8 100644
--- a/fuelweb_test/tests/tests_scale/test_scale_group_2.py
+++ b/fuelweb_test/tests/tests_scale/test_scale_group_2.py
@@ -27,25 +27,18 @@ class HaScaleGroup2(TestBasic):
27 """HaScaleGroup2.""" # TODO documentation 27 """HaScaleGroup2.""" # TODO documentation
28 28
29 @test(depends_on=[SetupEnvironment.prepare_slaves_5], 29 @test(depends_on=[SetupEnvironment.prepare_slaves_5],
30 groups=["replace_primary_controller"]) 30 groups=["ha_scale_group_2_cluster"])
31 @log_snapshot_after_test 31 @log_snapshot_after_test
32 def replace_primary_controller(self): 32 def ha_scale_group_2_cluster(self):
33 """Replace the primary controller in the cluster 33 """Deploy cluster with 3 controllers and 1 compute
34 34
35 Scenario: 35 Scenario:
36 1. Create cluster 36 1. Create cluster
37 2. Add 3 controller nodes and 1 compute 37 2. Add 3 controller nodes and 1 compute
38 3. Deploy the cluster 38 3. Deploy the cluster
39 4. Destroy primary controller
40 5. Wait controller offline
41 6. Remove offline controller from cluster
42 7. Add 1 new controller
43 8. Deploy changes
44 9. Run OSTF
45 10. Verify networks
46 39
47 Duration 120m 40 Duration 80m
48 Snapshot replace_primary_controller 41 Snapshot ha_scale_group_2_cluster
49 42
50 """ 43 """
51 self.env.revert_snapshot("ready_with_5_slaves") 44 self.env.revert_snapshot("ready_with_5_slaves")
@@ -65,6 +58,37 @@ class HaScaleGroup2(TestBasic):
65 ) 58 )
66 self.show_step(3) 59 self.show_step(3)
67 self.fuel_web.deploy_cluster_wait(cluster_id) 60 self.fuel_web.deploy_cluster_wait(cluster_id)
61 self.fuel_web.verify_network(cluster_id)
62 self.env.make_snapshot("ha_scale_group_2_cluster",
63 is_make=True)
64
65 @test(depends_on=[ha_scale_group_2_cluster],
66 groups=["replace_primary_controller"])
67 @log_snapshot_after_test
68 def replace_primary_controller(self):
69 """Replace the primary controller in the cluster
70
71 Scenario:
72 1. Create cluster
73 2. Add 3 controller nodes and 1 compute
74 3. Deploy the cluster
75 4. Destroy primary controller
76 5. Wait controller offline
77 6. Remove offline controller from cluster
78 7. Add 1 new controller
79 8. Deploy changes
80 9. Run OSTF
81 10. Verify networks
82
83 Duration 120m
84 Snapshot replace_primary_controller
85
86 """
87 self.env.revert_snapshot("ha_scale_group_2_cluster")
88 self.show_step(1, initialize=True)
89 self.show_step(2)
90 self.show_step(3)
91 cluster_id = self.fuel_web.get_last_created_cluster()
68 92
69 self.show_step(4) 93 self.show_step(4)
70 primary_controller = self.fuel_web.get_nailgun_primary_node( 94 primary_controller = self.fuel_web.get_nailgun_primary_node(
@@ -86,13 +110,13 @@ class HaScaleGroup2(TestBasic):
86 ) 110 )
87 self.show_step(8) 111 self.show_step(8)
88 self.fuel_web.deploy_cluster_wait(cluster_id) 112 self.fuel_web.deploy_cluster_wait(cluster_id)
89 self.show_step(10)
90 self.fuel_web.verify_network(cluster_id)
91 self.show_step(9) 113 self.show_step(9)
92 self.fuel_web.run_ostf(cluster_id=cluster_id) 114 self.fuel_web.run_ostf(cluster_id=cluster_id)
115 self.show_step(10)
116 self.fuel_web.verify_network(cluster_id)
93 self.env.make_snapshot("replace_primary_controller") 117 self.env.make_snapshot("replace_primary_controller")
94 118
95 @test(depends_on=[SetupEnvironment.prepare_slaves_5], 119 @test(depends_on=[ha_scale_group_2_cluster],
96 groups=["remove_controllers"]) 120 groups=["remove_controllers"])
97 @log_snapshot_after_test 121 @log_snapshot_after_test
98 def remove_controllers(self): 122 def remove_controllers(self):
@@ -114,31 +138,19 @@ class HaScaleGroup2(TestBasic):
114 Snapshot remove_controllers 138 Snapshot remove_controllers
115 139
116 """ 140 """
117 self.env.revert_snapshot("ready_with_5_slaves") 141 self.env.revert_snapshot("ha_scale_group_2_cluster")
118 self.show_step(1, initialize=True) 142 self.show_step(1, initialize=True)
119 cluster_id = self.fuel_web.create_cluster(
120 name=self.__class__.__name__,
121 mode=DEPLOYMENT_MODE)
122 self.show_step(2) 143 self.show_step(2)
123 self.fuel_web.update_nodes(
124 cluster_id,
125 {
126 'slave-01': ['controller'],
127 'slave-02': ['controller'],
128 'slave-03': ['controller'],
129 'slave-04': ['compute']
130 }
131 )
132 self.show_step(3) 144 self.show_step(3)
133 self.fuel_web.deploy_cluster_wait(cluster_id) 145 cluster_id = self.fuel_web.get_last_created_cluster()
134 146
135 hosts = [] 147 hosts = []
136 148
137 for node_name in ('slave-02', 'slave-03'): 149 for node_name in ('slave-02', 'slave-03'):
138 node = self.fuel_web.get_nailgun_node_by_devops_node( 150 node = self.fuel_web.get_nailgun_node_by_devops_node(
139 self.env.d_env.get_node(name=node_name)) 151 self.env.d_env.get_node(name=node_name))
140 hostname = ''.join(self.ssh_manager.execute_on_remote( 152 hostname = ''.join(self.ssh_manager.check_call(
141 ip=node['ip'], cmd="hostname")['stdout']).strip() 153 ip=node['ip'], command="hostname")['stdout']).strip()
142 hosts.append(hostname) 154 hosts.append(hostname)
143 logger.debug('hostname are {}'.format(hosts)) 155 logger.debug('hostname are {}'.format(hosts))
144 nodes = {'slave-02': ['controller'], 156 nodes = {'slave-02': ['controller'],
@@ -150,10 +162,10 @@ class HaScaleGroup2(TestBasic):
150 ) 162 )
151 self.show_step(5) 163 self.show_step(5)
152 self.fuel_web.deploy_cluster_wait(cluster_id) 164 self.fuel_web.deploy_cluster_wait(cluster_id)
153 self.show_step(7)
154 self.fuel_web.verify_network(cluster_id)
155 self.show_step(6) 165 self.show_step(6)
156 self.fuel_web.run_ostf(cluster_id=cluster_id) 166 self.fuel_web.run_ostf(cluster_id=cluster_id)
167 self.show_step(7)
168 self.fuel_web.verify_network(cluster_id)
157 169
158 node = self.fuel_web.get_nailgun_node_by_devops_node( 170 node = self.fuel_web.get_nailgun_node_by_devops_node(
159 self.env.d_env.get_node(name='slave-01')) 171 self.env.d_env.get_node(name='slave-01'))
@@ -162,15 +174,15 @@ class HaScaleGroup2(TestBasic):
162 self.show_step(8, initialize=True) 174 self.show_step(8, initialize=True)
163 cmd = "grep '{}' /etc/hosts".format(host) 175 cmd = "grep '{}' /etc/hosts".format(host)
164 logger.info('Checking hosts on {}'.format(host)) 176 logger.info('Checking hosts on {}'.format(host))
165 result = self.ssh_manager.execute_on_remote( 177 result = self.ssh_manager.check_call(
166 ip=node['ip'], cmd=cmd, assert_ec_equal=[1]) 178 ip=node['ip'], command=cmd, expected=[1])
167 assert_equal(result['exit_code'], 1, 179 assert_equal(result['exit_code'], 1,
168 "host {} is present in /etc/hosts".format(host)) 180 "host {} is present in /etc/hosts".format(host))
169 self.show_step(9) 181 self.show_step(9)
170 cmd = "grep '{}' /etc/corosync/corosync.conf".format(host) 182 cmd = "grep '{}' /etc/corosync/corosync.conf".format(host)
171 logger.info('Checking corosync.conf on {}'.format(host)) 183 logger.info('Checking corosync.conf on {}'.format(host))
172 result = self.ssh_manager.execute_on_remote( 184 result = self.ssh_manager.check_call(
173 ip=node['ip'], cmd=cmd, assert_ec_equal=[1]) 185 ip=node['ip'], command=cmd, expected=[1])
174 assert_equal(result['exit_code'], 1, 186 assert_equal(result['exit_code'], 1,
175 "host {} is present in" 187 "host {} is present in"
176 " /etc/corosync/corosync.conf".format(host)) 188 " /etc/corosync/corosync.conf".format(host))