Skip to content

Commit ac668b3

Browse files
committed
Prevent worker to fail on missing key and secret keys
The worker still fails but not due to misconfuration. But this time will throw an additional soft fail to make visible the issue with the containers' communication. poo: https://progress.opensuse.org/issues/186651 Signed-off-by: Ioannis Bonatakis <[email protected]>
1 parent 8e1ab16 commit ac668b3

File tree

2 files changed

+35
-5
lines changed

2 files changed

+35
-5
lines changed

tests/containers/single_container_webui.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ sub run {
1212
wait_for_container_log('openqa_webui', 'Web application available at', 'docker');
1313

1414
assert_script_run('curl http://localhost');
15-
assert_script_run('docker rm -f openqa_webui');
15+
#assert_script_run('docker rm -f openqa_webui');
1616
}
1717

1818
sub post_fail_hook {

tests/containers/worker.pm

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,40 @@ use testapi;
33
use utils;
44

55
sub run {
6-
my $volumes = '-v "/root/data/factory:/data/factory" -v "/root/data/tests:/data/tests" -v "/root/openQA/container/openqa_data/data.template/conf/:/data/conf:ro"';
7-
assert_script_run("docker run -d --network testing $volumes --name openqa_worker openqa_worker");
8-
wait_for_container_log('openqa_worker', 'API key and secret are needed', 'docker');
9-
clear_root_console;
6+
#my $apikey = '1234567890ABCDEF';
7+
#my $apikey = '1234567890ABCDEF';
8+
my $volumes = '-v "/root/data/factory:/data/factory" -v "/root/data/tests:/data/tests" -v "/root/openQA/container/openqa_data/data.template/conf/:/data/conf:ro"';
9+
script_output(
10+
"echo \"\$(cat <<EOF
11+
[openqa_webui]
12+
key = 1234567890ABCDEF
13+
secret = 1234567890ABCDEF
14+
15+
[localhost]
16+
key = 1234567890ABCDEF
17+
secret = 1234567890ABCDEF
18+
EOF
19+
)\" > /root/openQA/container/openqa_data/data.template/conf/client.conf"
20+
);
21+
script_output(
22+
"echo \"\$(cat <<EOF
23+
[global]
24+
BACKEND = qemu
25+
HOST = http://openqa_webui
26+
WORKER_HOSTNAME = openqa_worker
27+
EOF
28+
)\" > /root/openQA/container/openqa_data/data.template/conf/workers.ini"
29+
);
30+
assert_script_run("docker run -d --network testing $volumes --name openqa_worker openqa_worker");
31+
my $expected_log = 'Failed to register';
32+
wait_for_container_log('openqa_worker', 'Failed to register', 'docker');
33+
record_soft_failure("$expected_log - https://progress.opensuse.org/issues/186651");
34+
clear_root_console;
35+
}
36+
37+
sub post_run_hook {
38+
script_run('docker rm -f openqa_worker');
39+
script_run('docker rm -f openqa_webui');
1040
}
1141

1242
1;

0 commit comments

Comments
 (0)