Skip to content

Commit 370f4d3

Browse files
authored
Merge pull request #150 from thin-edge/tests-host-mounted-volume
tests: add test for verifying host volume mounts
2 parents 24ef5b3 + 75554f8 commit 370f4d3

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
@@ -159,6 +159,16 @@ Remove Orphaned Cloud Services
159159
Start Service tedge-container-plugin
160160
Cumulocity.Should Have Services name=manualapp4 min_count=0 max_count=0 timeout=10
161161

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

164174
Suite Setup
@@ -186,3 +196,10 @@ Install container-group file
186196
Operation Should Be SUCCESSFUL ${operation}
187197
Should Contain ${operation.to_json()["c8y_Command"]["result"]} My Custom Web Application
188198
Cumulocity.Should Have Services name=${package_name}@${service_name} service_type=container-group status=up
199+
200+
Install container-group application
201+
[Documentation] Install a container-group and let the user do follow up tests
202+
[Arguments] ${package_name} ${package_version} ${service_name} ${file}
203+
${binary_url}= Cumulocity.Create Inventory Binary ${package_name} container-group file=${file}
204+
${operation}= Cumulocity.Install Software {"name": "${package_name}", "version": "${package_version}", "softwareType": "container-group", "url": "${binary_url}"}
205+
Operation Should Be SUCCESSFUL ${operation} timeout=300

0 commit comments

Comments
 (0)