Skip to content

Commit cbe8b1d

Browse files
committed
In nginx
1 parent d90b23e commit cbe8b1d

File tree

3 files changed

+58
-6
lines changed

3 files changed

+58
-6
lines changed

data/containers/helm/kiosk/nginx.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: audio-html-config
6+
data:
7+
audio.html: |
8+
<!DOCTYPE html>
9+
<html>
10+
<head>
11+
<title>Sample audio file</title>
12+
</head>
13+
<body>
14+
<audio loop controls> <!-- autoplay is blocked in modern browsers -->
15+
<source src="https://github.com/os-autoinst/os-autoinst-distri-opensuse/raw/refs/heads/master/data/bar.wav" type="audio/wav">
16+
Your browser does not support the audio tag.
17+
</audio>
18+
</body>
19+
</html>
20+
---
21+
apiVersion: v1
22+
kind: Pod
23+
metadata:
24+
name: nginx-test
25+
labels:
26+
app: nginx-test
27+
spec:
28+
containers:
29+
- name: nginx
30+
image: registry.suse.com/suse/nginx
31+
volumeMounts:
32+
- name: html-volume
33+
mountPath: /srv/www/htdocs/audio.html
34+
subPath: audio.html
35+
volumes:
36+
- name: html-volume
37+
configMap:
38+
name: audio-html-config
39+
---
40+
apiVersion: v1
41+
kind: Service
42+
metadata:
43+
name: nginx-test
44+
spec:
45+
type: ClusterIP
46+
clusterIP: 10.43.0.69
47+
ports:
48+
- port: 80
49+
targetPort: 80
50+
selector:
51+
app: nginx-test

data/containers/helm/kiosk/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pulseaudio:
1414
tag: "17.0"
1515
workload:
1616
# Page to load if using firefox as the workload
17-
url: "https://freesound.org/people/kevp888/sounds/796468/"
17+
url: "http://10.43.0.69/audio.html"
1818
# Additional environment variables to passthrough into the workload
1919
env: []
2020
# These can be used to provide a custom workload

tests/containers/charts/kiosk.pm

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@ sub run {
2121

2222
select_serial_terminal;
2323
my $helm_chart = get_required_var("HELM_CHART");
24-
my $helm_values = autoinst_url("/data/containers/kiosk_helm_values.yaml");
24+
my $helm_values = autoinst_url("/data/containers/helm/kiosk/values.yaml");
2525

2626
# Install helm
27-
set_var('HELM_INSTALL_UPSTREAM', 1);
2827
install_helm();
2928

29+
# Run an nginx container with a test page and wait for it
30+
assert_script_run("kubectl apply -f " . autoinst_url("/data/containers/helm/kiosk/nginx.yaml"));
31+
assert_script_run("kubectl wait --for=condition=Ready pod/nginx-test --timeout=60s");
32+
3033
# login to graphical tty before starting
3134
select_console 'root-console';
3235

@@ -38,12 +41,10 @@ sub run {
3841
select_console 'root-console';
3942
assert_screen("firefox_kiosk", 300);
4043
assert_and_click("firefox_play_audio");
41-
# Enable loop play to ensure the "pactl list sink-inputs" can get a verbose list for each active audio stream
42-
assert_and_click("firefox_loop_play");
4344

4445
select_serial_terminal;
4546

46-
my $pod_name = script_output("kubectl get pods -o name | cut -d '/' -f 2");
47+
my $pod_name = script_output("kubectl get pods -o name | grep kiosk | cut -d '/' -f 2");
4748

4849
# check if pulseaudio is running
4950
validate_script_output("kubectl exec $pod_name -c pulseaudio -- sh -c 'ps aux'", qr/^pulse.*pulseaudio$/m);

0 commit comments

Comments
 (0)