|
10 | 10 | describe 'set up controller' do |
11 | 11 | it 'sets up the controller' do |
12 | 12 | run_shell('puppet agent --test', expect_failures: true) do |r| |
13 | | - expect(r.exit_code.to_s).to match(/0|2/) |
| 13 | + expect(r.exit_code.to_s).to match(%r{0|2}) |
14 | 14 | end |
15 | 15 | end |
16 | 16 | end |
|
21 | 21 | describe 'set up worker' do |
22 | 22 | it 'sets up the worker' do |
23 | 23 | run_shell('puppet agent --test', expect_failures: true) do |r| |
24 | | - expect(r.exit_code.to_s).to match(/0|2/) |
| 24 | + expect(r.exit_code.to_s).to match(%r{0|2}) |
25 | 25 | end |
26 | 26 | end |
27 | 27 | end |
|
32 | 32 | describe 'set up worker' do |
33 | 33 | it 'sets up the worker' do |
34 | 34 | run_shell('puppet agent --test', expect_failures: true) do |r| |
35 | | - expect(r.exit_code.to_s).to match(/0|2/) |
| 35 | + expect(r.exit_code.to_s).to match(%r{0|2}) |
36 | 36 | end |
37 | 37 | end |
38 | 38 | end |
39 | 39 | end |
40 | 40 | context 'verify the k8 nodes' do |
41 | 41 | before(:all) { change_target_host('controller') } |
42 | | - hostname1, ipaddr1, int_ipaddr1 = fetch_ip_hostname_by_role('controller') |
43 | | - hostname2, ipaddr2, int_ipaddr2 = fetch_ip_hostname_by_role('worker1') |
44 | | - hostname3, ipaddr3, int_ipaddr3 = fetch_ip_hostname_by_role('worker2') |
| 42 | + hostname1, _ipaddr1, = fetch_ip_hostname_by_role('controller') |
| 43 | + hostname2, _ipaddr2, = fetch_ip_hostname_by_role('worker1') |
| 44 | + hostname3, _ipaddr3, = fetch_ip_hostname_by_role('worker2') |
45 | 45 | after(:all) { reset_target_host } |
46 | 46 | describe 'verify the k8 nodes' do |
47 | 47 | it 'verify the k8 nodes' do |
48 | 48 | run_shell('sleep 20') |
49 | 49 | run_shell('KUBECONFIG=/etc/kubernetes/admin.conf kubectl get nodes') do |r| |
50 | | - expect(r.stdout).to match(/#{hostname1}(\s)+Ready(\s)+control-plane,master/) |
51 | | - expect(r.stdout).to match(/#{hostname2}(\s)+Ready/) |
52 | | - expect(r.stdout).to match(/#{hostname3}(\s)+Ready/) |
| 50 | + expect(r.stdout).to match(%r{#{hostname1}(\s)+Ready(\s)+control-plane,master}) |
| 51 | + expect(r.stdout).to match(%r{#{hostname2}(\s)+Ready}) |
| 52 | + expect(r.stdout).to match(%r{#{hostname3}(\s)+Ready}) |
53 | 53 | end |
54 | 54 | end |
55 | 55 | end |
|
0 commit comments