Skip to content

Commit 3e58d6f

Browse files
committed
Update Docker build arguments and directories
The templates are almost entirely modified and in order to provide a clean configuration for the test case, it is better to not use them at all. This, hopefully descreases the complexity and provides a clean overview of the minimal configuration that the container is needed. Furthermore, this commit is depended on the webui Dockerfile, which should be provide the proxy configuration on the webui container for the build. Depends-on: os-autoinst/openQA#6751 Signed-off-by: Ioannis Bonatakis <[email protected]>
1 parent 3b706d2 commit 3e58d6f

File tree

2 files changed

+11
-41
lines changed

2 files changed

+11
-41
lines changed

tests/containers/single_container_webui.pm

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,7 @@ use testapi;
33
use utils;
44

55
sub run {
6-
script_run(
7-
"echo \"\$(cat <<EOF
8-
[localhost]
9-
key = 1234567890ABCDEF
10-
secret = 1234567890ABCDEF
11-
12-
[scheduler]
13-
key = 1234567890ABCDEF
14-
secret = 1234567890ABCDEF
15-
16-
[websockets]
17-
key = 1234567890ABCDEF
18-
secret = 1234567890ABCDEF
19-
20-
[openqa_webui]
21-
key = 1234567890ABCDEF
22-
secret = 1234567890ABCDEF
23-
EOF
24-
)\" > /root/openQA/container/webui/conf/client.conf");
25-
script_run(
6+
assert_script_run(
267
"echo \"\$(cat <<EOF
278
[global]
289
# change to the URL the web UI will be available under so redirection for
@@ -31,12 +12,6 @@ base_url = http://openqa_webui
3112
3213
[auth]
3314
method = Fake
34-
35-
[logging]
36-
level = debug
37-
38-
[openid]
39-
httpsonly = 0
4015
EOF
4116
)\" > /root/openQA/container/webui/conf/openqa.ini");
4217

@@ -47,11 +22,7 @@ EOF
4722

4823
assert_script_run("docker run -d --network testing $volumes $certificates -p 80:80 --hostname openqa_webui --name openqa_webui openqa_webui");
4924
wait_for_container_log('openqa_webui', 'Web application available at', 'docker');
50-
51-
assert_script_run('curl http://localhost');
52-
assert_script_run(qq{docker exec openqa_webui sed -i "s/#ServerName your.server.name/ServerName openqa_webui/" /etc/apache2/vhosts.d/openqa.conf});
53-
assert_script_run(qq{docker exec openqa_webui sh -c 'echo "ServerName openqa_webui" >> /etc/apache2/httpd.conf'});
54-
assert_script_run(qq{docker exec openqa_webui apache2ctl restart});
25+
assert_script_run('curl -v http://localhost');
5526
}
5627

5728
sub post_fail_hook {

tests/containers/worker.pm

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,27 @@ 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-
script_run(
6+
my $confdir = '/tmp/openqa_worker_conf';
7+
assert_script_run("mkdir -p $confdir");
8+
assert_script_run(
89
"echo \"\$(cat <<EOF
910
[openqa_webui]
1011
key = 1234567890ABCDEF
1112
secret = 1234567890ABCDEF
12-
13-
[localhost]
14-
key = 1234567890ABCDEF
15-
secret = 1234567890ABCDEF
1613
EOF
17-
)\" > /root/openQA/container/openqa_data/data.template/conf/client.conf");
14+
)\" > $confdir/client.conf");
1815

19-
script_run(
16+
assert_script_run(
2017
"echo \"\$(cat <<EOF
2118
[global]
2219
BACKEND = qemu
2320
HOST = openqa_webui
2421
WORKER_HOSTNAME = openqa_worker
2522
EOF
26-
)\" > /root/openQA/container/openqa_data/data.template/conf/workers.ini");
27-
assert_script_run(qq{docker run -d --network testing $volumes --entrypoint sh --hostname openqa_worker --name openqa_worker openqa_worker -c "curl -v http://openqa_webui/login && ./run_openqa_worker.sh"});
23+
)\" > $confdir/workers.ini");
24+
my $volumes = qq{-v "/root/data/factory:/data/factory" -v "/root/data/tests:/data/tests" -v "$confdir:/data/conf:ro"};
25+
assert_script_run('curl -v http://localhost/login');
26+
assert_script_run(qq{docker run -d --network testing $volumes --hostname openqa_worker --name openqa_worker openqa_worker});
2827
wait_for_container_log('openqa_worker', 'Registered and connected', 'docker');
2928
clear_root_console;
3029
}

0 commit comments

Comments
 (0)