@@ -16,33 +16,18 @@ use utils;
16
16
use containers::helm;
17
17
use containers::k8s qw( install_helm) ;
18
18
19
-
20
- my $base_url = autoinst_url;
21
- my $audio_html = <<_EOF_ ;
22
- <!DOCTYPE html>
23
- <html>
24
- <head>
25
- <title>Sample audio file</title>
26
- </head>
27
- <body>
28
- <audio loop controls> <!-- autoplay is blocked in modern browsers -->
29
- <source src="$base_url /data/bar.wav" type="audio/wav">
30
- Your browser does not support the audio tag.
31
- </audio>
32
- </body>
33
- </html>
34
- _EOF_
35
-
36
19
sub run {
37
20
my ($self ) = @_ ;
38
21
39
22
select_serial_terminal;
40
23
my $helm_chart = get_required_var(" HELM_CHART" );
41
- my $helm_values = autoinst_url( " /data /containers/helm/kiosk/values.yaml" );
24
+ my $helm_values = data_url( " /containers/helm/kiosk/values.yaml" );
42
25
43
26
# Run an nginx container with a test page and wait for it
44
- assert_script_run(" kubectl create configmap audio-html-config --from-literal=audio.html='$audio_html '" );
45
- assert_script_run(" kubectl apply -f " . autoinst_url(" /data/containers/helm/kiosk/nginx.yaml" ));
27
+ assert_script_run(" curl -O " . data_url(" /containers/helm/kiosk/audio.html" ));
28
+ file_content_replace(" audio.html" , ' %DATA_URL%' => data_url);
29
+ assert_script_run(" kubectl create configmap audio-html-config --from-file=audio.html" );
30
+ assert_script_run(" kubectl apply -f " . data_url(" /containers/helm/kiosk/nginx.yaml" ));
46
31
assert_script_run(" kubectl wait --for=condition=Ready pod/nginx-test --timeout=60s" );
47
32
48
33
# login to graphical tty before starting
@@ -64,7 +49,7 @@ sub run {
64
49
validate_script_output(" kubectl exec $pod_name -c pulseaudio -- sh -c 'pactl list sink-inputs'" , qr / application.name = "Firefox"/ m && qr / application.process.host = "$pod_name "/ m , fail_message => ' firefox did not allocate an audio sink' );
65
50
66
51
assert_script_run(" helm uninstall kiosk" );
67
- script_run(" kubectl delete -f " . autoinst_url( " /data /containers/helm/kiosk/nginx.yaml" ));
52
+ script_run(" kubectl delete -f " . data_url( " /containers/helm/kiosk/nginx.yaml" ));
68
53
script_run(" kubectl create configmap audio-html-config" );
69
54
}
70
55
0 commit comments