@@ -17,39 +17,37 @@ def tearDown(self):
17
17
18
18
@requires_api_version ('1.24' )
19
19
def test_init_swarm_simple (self ):
20
- assert self .client . init_swarm ('eth0' )
20
+ assert self .init_swarm ()
21
21
22
22
@requires_api_version ('1.24' )
23
23
def test_init_swarm_force_new_cluster (self ):
24
24
pytest .skip ('Test stalls the engine on 1.12.0' )
25
25
26
- assert self .client . init_swarm ('eth0' )
26
+ assert self .init_swarm ()
27
27
version_1 = self .client .inspect_swarm ()['Version' ]['Index' ]
28
- assert self .client .init_swarm ('eth0' , force_new_cluster = True )
28
+ assert self .client .init_swarm (force_new_cluster = True )
29
29
version_2 = self .client .inspect_swarm ()['Version' ]['Index' ]
30
30
assert version_2 != version_1
31
31
32
32
@requires_api_version ('1.24' )
33
33
def test_init_already_in_cluster (self ):
34
- assert self .client . init_swarm ('eth0' )
34
+ assert self .init_swarm ()
35
35
with pytest .raises (docker .errors .APIError ):
36
- self .client . init_swarm ('eth0' )
36
+ self .init_swarm ()
37
37
38
38
@requires_api_version ('1.24' )
39
39
def test_init_swarm_custom_raft_spec (self ):
40
40
spec = self .client .create_swarm_spec (
41
41
snapshot_interval = 5000 , log_entries_for_slow_followers = 1200
42
42
)
43
- assert self .client .init_swarm (
44
- advertise_addr = 'eth0' , swarm_spec = spec
45
- )
43
+ assert self .init_swarm (swarm_spec = spec )
46
44
swarm_info = self .client .inspect_swarm ()
47
45
assert swarm_info ['Spec' ]['Raft' ]['SnapshotInterval' ] == 5000
48
46
assert swarm_info ['Spec' ]['Raft' ]['LogEntriesForSlowFollowers' ] == 1200
49
47
50
48
@requires_api_version ('1.24' )
51
49
def test_leave_swarm (self ):
52
- assert self .client . init_swarm ('eth0' )
50
+ assert self .init_swarm ()
53
51
with pytest .raises (docker .errors .APIError ) as exc_info :
54
52
self .client .leave_swarm ()
55
53
exc_info .value .response .status_code == 500
@@ -61,7 +59,7 @@ def test_leave_swarm(self):
61
59
62
60
@requires_api_version ('1.24' )
63
61
def test_update_swarm (self ):
64
- assert self .client . init_swarm ('eth0' )
62
+ assert self .init_swarm ()
65
63
swarm_info_1 = self .client .inspect_swarm ()
66
64
spec = self .client .create_swarm_spec (
67
65
snapshot_interval = 5000 , log_entries_for_slow_followers = 1200 ,
@@ -92,7 +90,7 @@ def test_update_swarm(self):
92
90
93
91
@requires_api_version ('1.24' )
94
92
def test_update_swarm_name (self ):
95
- assert self .client . init_swarm ('eth0' )
93
+ assert self .init_swarm ()
96
94
swarm_info_1 = self .client .inspect_swarm ()
97
95
spec = self .client .create_swarm_spec (
98
96
node_cert_expiry = 7776000000000000 , name = 'reimuhakurei'
@@ -110,7 +108,7 @@ def test_update_swarm_name(self):
110
108
111
109
@requires_api_version ('1.24' )
112
110
def test_list_nodes (self ):
113
- assert self .client . init_swarm ('eth0' )
111
+ assert self .init_swarm ()
114
112
nodes_list = self .client .nodes ()
115
113
assert len (nodes_list ) == 1
116
114
node = nodes_list [0 ]
@@ -129,7 +127,7 @@ def test_list_nodes(self):
129
127
130
128
@requires_api_version ('1.24' )
131
129
def test_inspect_node (self ):
132
- assert self .client . init_swarm ('eth0' )
130
+ assert self .init_swarm ()
133
131
nodes_list = self .client .nodes ()
134
132
assert len (nodes_list ) == 1
135
133
node = nodes_list [0 ]
@@ -139,7 +137,7 @@ def test_inspect_node(self):
139
137
140
138
@requires_api_version ('1.24' )
141
139
def test_update_node (self ):
142
- assert self .client . init_swarm ('eth0' )
140
+ assert self .init_swarm ()
143
141
nodes_list = self .client .nodes ()
144
142
node = nodes_list [0 ]
145
143
orig_spec = node ['Spec' ]
@@ -162,7 +160,7 @@ def test_update_node(self):
162
160
163
161
@requires_api_version ('1.24' )
164
162
def test_remove_main_node (self ):
165
- assert self .client . init_swarm ('eth0' )
163
+ assert self .init_swarm ()
166
164
nodes_list = self .client .nodes ()
167
165
node_id = nodes_list [0 ]['ID' ]
168
166
with pytest .raises (docker .errors .NotFound ):
0 commit comments