-
Notifications
You must be signed in to change notification settings - Fork 0
/
.container-structure-test.yaml
93 lines (88 loc) · 2.55 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
83
84
85
86
87
88
89
90
91
92
93
# container structure test configuration
schemaVersion: '2.0.0'
metadataTest:
env:
- key: PATH
value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
entrypoint: []
cmd: ["bash"]
exposedPorts: []
volumes: []
commandTests:
- name: "check terraform is found in $PATH"
command: "which"
args: ["terraform"]
expectedOutput: ['/usr/local/bin/terraform']
exitCode: 0
- name: "check terraform version"
command: "terraform"
args: ["version"]
expectedOutput: ['Terraform v0.11.10']
exitCode: 0
- name: "check kubectl is found in $PATH"
command: "which"
args: ["kubectl"]
expectedOutput: ['/usr/local/bin/kubectl']
- name: "check kubectl version"
command: "kubectl"
args: ["version", "--client", "--short"]
expectedOutput: ['Client Version: v1.10.3']
- name: "check aws-iam-authenticator is found in $PATH"
command: "which"
args: ["aws-iam-authenticator"]
expectedOutput: ['/usr/local/bin/aws-iam-authenticator']
- name: "check aws-iam-authenticator is executable"
command: "aws-iam-authenticator"
args: ["help"]
expectedOutput:
- '.*heptio-authenticator-aws.*'
- '.*Available Commands.*'
- '.*help.*'
- '.*init.*'
- '.*server.*'
- '.*token.*'
exitCode: 0
fileExistenceTests:
- name: 'FILE check docker-disable-recommends exists'
path: '/etc/apt/apt.conf.d/docker-disable-recommends'
shouldExist: true
permissions: '-rw-r--r--'
uid: 0
gid: 0
- name: 'check /usr/share/man/man1 exists'
path: '/usr/share/man/man1'
shouldExist: true
permissions: 'drwxr-xr-x'
uid: 0
gid: 0
- name: 'check /usr/share/man/man7 exists'
path: '/usr/share/man/man1'
shouldExist: true
permissions: 'drwxr-xr-x'
uid: 0
gid: 0
- name: 'check /usr/local/bin/terraform exists and executable'
path: '/usr/local/bin/terraform'
shouldExist: true
permissions: '-rwxr-xr-x'
uid: 0
gid: 0
isExecutableBy: 'any'
- name: 'check /usr/local/bin/kubectl exists and executable'
path: '/usr/local/bin/kubectl'
shouldExist: true
permissions: '-rwxr-xr-x'
uid: 0
gid: 0
isExecutableBy: 'any'
- name: 'check aws-iam-authenticator exists and executable'
path: '/usr/local/bin/aws-iam-authenticator'
shouldExist: true
permissions: '-rwxr-xr-x'
uid: 0
gid: 0
isExecutableBy: 'any'
fileContentTests:
- name: 'APT disable install recommends'
expectedContents: ['APT::Install-Recommends "false";']
path: '/etc/apt/apt.conf.d/docker-disable-recommends'