Skip to content

Commit 75554f8

Browse files
committed
add test for verifying host volume mounts
1 parent 87021ec commit 75554f8

File tree

5 files changed

+53
-0
lines changed

5 files changed

+53
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ tests/data/apps/app1.tar.gz
1717
tests/data/apps/app2.zip
1818
tests/data/apps/app3.tar
1919
tests/data/apps/app4.tar.gz
20+
tests/data/apps/app5.tar.gz
2021

2122
# MacOS
2223
.DS_Store
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
services:
2+
httpd:
3+
image: docker.io/library/httpd:latest
4+
volumes:
5+
- ./htdocs:/var/www/html
6+
ports:
7+
- 9082:80
8+
restart: always
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE html>
2+
<html>
3+
4+
<head>
5+
<title>My Custom Web Application</title>
6+
<style>
7+
html {
8+
color-scheme: light dark;
9+
}
10+
11+
body {
12+
width: 35em;
13+
margin: 0 auto;
14+
font-family: Tahoma, Verdana, Arial, sans-serif;
15+
}
16+
</style>
17+
</head>
18+
19+
<body>
20+
<h1>My Custom Web Application</h1>
21+
<p>If you see this page, the nginx web server is successfully installed and
22+
working. Further configuration is required.</p>
23+
</body>
24+
25+
</html>

tests/data/apps/build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ fi
1616

1717
(cd app4 && tar czvf ../app4.tar.gz docker-compose.yaml Dockerfile)
1818

19+
(cd app5 && tar czvf ../app5.tar.gz docker-compose.yaml htdocs)
20+
1921
popd ||:

tests/operations.robot

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,16 @@ Remove Orphaned Cloud Services
155155
Start Service tedge-container-plugin
156156
Cumulocity.Should Have Services name=manualapp4 min_count=0 max_count=0 timeout=10
157157

158+
Install container group that uses host volume mount
159+
# Install container-group
160+
Install container-group application app5 1.0.0 app5 ${CURDIR}/data/apps/app5.tar.gz
161+
Device Should Have Installed Software {"name": "app5", "version": "1.0.0", "softwareType": "container-group"}
162+
Cumulocity.Should Have Services name=app5@httpd service_type=container-group status=up
163+
164+
${operation}= Cumulocity.Execute Shell Command text=curl -sf http://127.0.0.1:9082
165+
${operation}= Operation Should Be SUCCESSFUL ${operation}
166+
Should Contain ${operation["c8y_Command"]["result"]} It works
167+
158168
*** Keywords ***
159169

160170
Suite Setup
@@ -182,3 +192,10 @@ Install container-group file
182192
Operation Should Be SUCCESSFUL ${operation}
183193
Should Contain ${operation.to_json()["c8y_Command"]["result"]} My Custom Web Application
184194
Cumulocity.Should Have Services name=${package_name}@${service_name} service_type=container-group status=up
195+
196+
Install container-group application
197+
[Documentation] Install a container-group and let the user do follow up tests
198+
[Arguments] ${package_name} ${package_version} ${service_name} ${file}
199+
${binary_url}= Cumulocity.Create Inventory Binary ${package_name} container-group file=${file}
200+
${operation}= Cumulocity.Install Software {"name": "${package_name}", "version": "${package_version}", "softwareType": "container-group", "url": "${binary_url}"}
201+
Operation Should Be SUCCESSFUL ${operation} timeout=300

0 commit comments

Comments
 (0)