-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathenv_setup.py
72 lines (54 loc) · 2.12 KB
/
env_setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
"""
Functions for environment preparition and cleanup.
"""
import behave
def host_subscribed_prepare(context):
context.execute_steps(u"""
When "{hosts}" host is auto-subscribed to "{server}"
Then subscription status is ok on "{hosts}"
And "1" entitlement is consumed on "{hosts}"
""".format(hosts=context.hosts,
server=context.subman_server))
print("Register %s hosts to %s" % (context.hosts, context.subman_server))
def host_subscribed_cleanup(context):
context.execute_steps(u"""
Then "{hosts}" host is unsubscribed And unregistered
And subscription status is unknown on "all"
""".format(hosts=context.hosts))
print("Unregister %s hosts" % context.hosts)
def ah_upgrade_prepare(context):
context.execute_steps(u"""
Given get the number of atomic host tree deployed
When confirm atomic host tree to old version
And atomic host upgrade is successful
Then wait "60" seconds for "all" to reboot
And there is "2" atomic host tree deployed
""")
def ah_upgrade_no_reboot_prepare(context):
context.execute_steps(u"""
Given get the number of atomic host tree deployed
When confirm atomic host tree to old version
And atomic host upgrade is successful
And there is "2" atomic host tree deployed
""")
def services_status_prepare(context):
context.execute_steps(u"""
Given get the services from configure file
Then update services original status
And setup services based on configure file""")
def services_status_cleanup(context):
context.execute_steps(u"""
Given "enable" "all" services
And "disable" "disabled" services
Then wait "30" seconds for "all" to reboot
""")
def etcd_prepare(context):
context.execute_steps(u"""
Given get etcd help
And get etcd.conf context from "all"
Then setup services based on configure file
""")
def etcd_cleanup(context):
context.execute_steps(u"""
Then set etcd.conf to "/var/tmp/etcd_default" in "all"
""")