1010
1111@pytest.fixture(scope="session")
1212def up_node1():
13- subproc.check_call(['sudo', ' vagrant', 'destroy', '-f', 'node1'])
14- subproc.check_call(['sudo', ' vagrant', 'up', 'node1'])
13+ subproc.check_call(['vagrant', 'destroy', '-f', 'node1'])
14+ subproc.check_call(['vagrant', 'up', 'node1'])
1515 yield "node1 is ready"
1616
1717 print("Destroying node1...")
18- subproc.call(['sudo', ' vagrant', 'destroy', '-f', 'node1'])
18+ subproc.call(['vagrant', 'destroy', '-f', 'node1'])
1919 print("Node1 is destroyed.")
2020
2121
2222@pytest.fixture(scope="session")
2323def up_node2():
24- subproc.check_call(['sudo', ' vagrant', 'destroy', '-f', 'node2'])
25- subproc.check_call(['sudo', ' vagrant', 'up', 'node2'])
24+ subproc.check_call(['vagrant', 'destroy', '-f', 'node2'])
25+ subproc.check_call(['vagrant', 'up', 'node2'])
2626 yield "node2 is ready"
2727
2828 print("Destroying node2...")
29- subproc.call(['sudo', ' vagrant', 'destroy', '-f', 'node2'])
29+ subproc.call(['vagrant', 'destroy', '-f', 'node2'])
3030 print("Node2 is destroyed.")
3131
3232
3333@pytest.fixture(scope="session")
3434def up_node3():
35- subproc.check_call(['sudo', ' vagrant', 'destroy', '-f', 'node3'])
36- subproc.check_call(['sudo', ' vagrant', 'up', 'node3'])
35+ subproc.check_call(['vagrant', 'destroy', '-f', 'node3'])
36+ subproc.check_call(['vagrant', 'up', 'node3'])
3737 yield "node3 is ready"
3838
3939 print("Destroying node3...")
40- subproc.call(['sudo', ' vagrant', 'destroy', '-f', 'node3'])
40+ subproc.call(['vagrant', 'destroy', '-f', 'node3'])
4141 print("Node3 is destroyed.")
4242
4343
4444@pytest.fixture(scope="session")
4545def bootstrap(up_node1):
4646 subproc.check_call([
47- 'sudo', ' vagrant', 'ssh', 'node1', '-c',
47+ 'vagrant', 'ssh', 'node1', '-c',
4848 'sudo /vagrant/bootstrap -m https://l2ohopf9.mirror.aliyuncs.com -r docker.io/laincloud --vip={}'.
4949 format(CONFIG.vip)
5050 ])
@@ -53,7 +53,7 @@ def bootstrap(up_node1):
5353@pytest.fixture(scope="session")
5454def prepare_demo_images(bootstrap):
5555 subproc.check_call([
56- 'sudo', ' vagrant', 'ssh', 'node1', '-c',
56+ 'vagrant', 'ssh', 'node1', '-c',
5757 'sudo sh /vagrant/bootstrap_test/prepare_demo_images.sh'
5858 ])
5959
@@ -78,12 +78,12 @@ def deploy_ipaddr(reposit_ipaddr):
7878@pytest.fixture(scope="session")
7979def add_node(bootstrap, up_node2, up_node3):
8080 subproc.check_call([
81- 'sudo', ' vagrant', 'ssh', 'node1', '-c',
81+ 'vagrant', 'ssh', 'node1', '-c',
8282 'cd /vagrant/bootstrap_test && sudo ansible-playbook \
8383 -i host_vars/test-nodes distribute_ssh_key.yaml'
8484 ])
8585 subproc.check_call([
86- 'sudo', ' vagrant', 'ssh', 'node1', '-c',
86+ 'vagrant', 'ssh', 'node1', '-c',
8787 'sudo lainctl node add -p /vagrant/playbooks node2:192.168.77.22 ' +
8888 'node3:192.168.77.23'
8989 ])
@@ -93,4 +93,4 @@ def add_node(bootstrap, up_node2, up_node3):
9393def scale_ipaddr_client(deploy_ipaddr, add_node):
9494 app_ctl.scale(CONFIG.ipaddr_client_appname, CONFIG.ipaddr_client_procname,
9595 CONFIG.ipaddr_client_num_instances)
96- time.sleep(60 )
96+ time.sleep(120 )
0 commit comments