-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
container-structure-test.yaml
82 lines (82 loc) · 2.71 KB
/
container-structure-test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Container Structure Test for 'Archivy' image
#
schemaVersion: 2.0.0
metadataTest:
labels:
- key: 'org.opencontainers.image.vendor'
value: 'Uzay G'
- key: 'org.opencontainers.image.title'
value: 'Archivy'
- key: 'org.opencontainers.image.authors'
value: 'https://github.com/Uzay-G'
- key: 'org.opencontainers.image.url'
value: 'https://github.com/archivy/archivy/tree/master/'
- key: 'org.label-schema.vcs-url'
value: 'https://github.com/archivy/archivy/tree/master/'
- key: 'org.opencontainers.image.documentation'
value: 'https://github.com/archivy/archivy/blob/master/README.md'
- key: 'org.opencontainers.image.source'
value: 'https://github.com/archivy/archivy/blob/docker/Dockerfile'
- key: 'org.opencontainers.image.licenses'
value: 'MIT'
- key: 'org.label-schema.schema-version'
value: '1.0'
entrypoint: ["entrypoint.sh"]
cmd: ["run"]
volumes: ["/archivy/data"]
exposedPorts: ["5000"]
fileExistenceTests:
- name: 'Check if /usr/local/bin directory exists'
path: '/usr/local/bin'
shouldExist: true
permissions: 'drwxr-xr-x'
isExecutableBy: 'any'
- name: 'Check if /usr/local/lib directory exists'
path: '/usr/local/lib'
shouldExist: true
permissions: 'drwxr-xr-x'
isExecutableBy: 'any'
- name: 'Check if archivy executable exists'
path: '/usr/local/bin/archivy'
shouldExist: true
permissions: '-rwxr-xr-x'
isExecutableBy: 'any'
- name: 'Check if /archivy/data directory exists'
path: '/archivy/data'
shouldExist: true
permissions: 'dgrwxr-xr-x'
isExecutableBy: 'any'
- name: 'Check if /usr/local/bin/entrypoint.sh file exists'
path: '/usr/local/bin/entrypoint.sh'
shouldExist: true
permissions: '-rwxr-xr-x'
isExecutableBy: 'any'
- name: 'Check if /usr/local/bin/healthcheck.sh file exists'
path: '/usr/local/bin/healthcheck.sh'
shouldExist: true
permissions: '-rwxr-xr-x'
isExecutableBy: 'any'
commandTests:
- name: 'Check if archivy is installed in PATH'
setup: [["entrypoint.sh", "sleep 1"]]
command: "which"
args: ["archivy"]
exitCode: 0
expectedOutput: ["/usr/local/bin/archivy"]
- name: 'Check if running as non-root user'
setup: [["entrypoint.sh", "sleep 1"]]
command: "whoami"
expectedOutput: ["archivy"]
exitCode: 0
- name: 'Check group of non-root user'
setup: [["entrypoint.sh", "sleep 1"]]
command: "groups"
args: ["archivy"]
expectedOutput: ["archivy"]
exitCode: 0
- name: 'Check user details'
setup: [["entrypoint.sh", "sleep 1"]]
command: "getent"
args: ["passwd", "archivy"]
expectedOutput: ["archivy:x:1000:1000:(.*):/archivy:/sbin/nologin"]
exitCode: 0