Skip to content

Commit 406fa03

Browse files
authored
Produce linux/s390x and linux/ppc64le binaries for use in container_test (#269)
Signed-off-by: Yulia Gaponenko <[email protected]>
1 parent 4a87521 commit 406fa03

9 files changed

+221
-0
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ dist: trusty
44
arch:
55
- amd64
66
- arm64
7+
- s390x
8+
- ppc64le
79

810
language: go
911
go:

deploy/cloudbuild.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@ steps:
1414
args: ['make', 'cross']
1515
env: ['GOARCH=arm64']
1616

17+
# Do the go build for s390x
18+
- name: 'builder'
19+
args: ['make', 'cross']
20+
env: ['GOARCH=s390x']
21+
22+
# Do the go build for ppc64le
23+
- name: 'builder'
24+
args: ['make', 'cross']
25+
env: ['GOARCH=ppc64le']
26+
27+
1728
# Upload to GCS
1829
- name: 'gcr.io/cloud-builders/gsutil'
1930
args: ['cp', '-r', 'out/*', 'gs://container-structure-test/builds/$COMMIT_SHA/']

deploy/release_cloudbuild.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ steps:
1515
args: ['make', 'cross']
1616
env: ['GOARCH=arm64']
1717

18+
# Do the go build for s390x
19+
- name: 'builder'
20+
args: ['make', 'cross']
21+
env: ['GOARCH=s390x']
22+
23+
# Do the go build for s390x
24+
- name: 'builder'
25+
args: ['make', 'cross']
26+
env: ['GOARCH=ppc64le']
27+
1828
# Upload to GCS
1929
- name: 'gcr.io/cloud-builders/gsutil'
2030
args: ['cp', '-r', 'out/*', 'gs://container-structure-test/$TAG_NAME/']
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
schemaVersion: '1.0.0'
2+
commandTests:
3+
- name: 'bad apt-get-command'
4+
command: ['apt-get', 'dslkfjasl']
5+
excludedError: ['.*FAIL.*']
6+
expectedOutput: ['.*Usage.*']
7+
- name: 'apt-config'
8+
command: ['apt-config', 'dump']
9+
expectedOutput: ['Acquire::Retries "3"']
10+
name: 'apt-config'
11+
- name: 'path'
12+
command: ['sh', '-c', 'echo $PATH']
13+
expectedOutput: ['/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin']
14+
fileContentTests:
15+
- name: 'Debian Sources'
16+
excludedContents: ['.*gce_debian_mirror.*']
17+
expectedContents: ['.*httpredir\.debian\.org.*']
18+
path: '/etc/apt/sources.list'
19+
- name: 'Wrong Retry Policy'
20+
expectedContents: ['Acquire::Retries 4;']
21+
path: '/etc/apt/apt.conf.d/apt-retry'
22+
fileExistenceTests:
23+
- name: 'Fake Dir'
24+
path: '/foo/bar'
25+
shouldExist: true
26+
- name: 'Wrong permissions'
27+
path: '/etc/apt/sources.list'
28+
permissions: '-rwxrwxrwx'
29+
shouldExist: true
30+
licenseTests:
31+
- debian: true
32+
files:
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
schemaVersion: '2.0.0' # Make sure to test the latest schema version
2+
metadataTest:
3+
env:
4+
- key: 'SOME_KEY'
5+
value: 'SOME_VAL'
6+
- key: 'EMPTY_VAR'
7+
value: ''
8+
- key: 'FOO_BAR'
9+
value: 'FOO\:BAR=BAZ'
10+
- key: 'REGEX_VAR'
11+
value: '[a-z]+-2\.1\.*'
12+
isRegex: true
13+
labels:
14+
- key: 'localnet.localdomain.commit_hash'
15+
value: '0123456789abcdef0123456789abcdef01234567'
16+
- key: 'localnet.my-domain.my-label'
17+
value: 'my .+ label'
18+
isRegex: true
19+
- key: 'label-with-empty-val'
20+
value: ''
21+
unexposedPorts: ['80']
22+
unmountedVolumes: ['/root']
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
schemaVersion: '2.0.0' # Make sure to test the latest schema version
2+
commandTests:
3+
- name: 'apt-get'
4+
command: 'apt-get'
5+
args: ['help']
6+
excludedError: ['.*FAIL.*']
7+
expectedOutput: ['.*Usage.*']
8+
- name: 'apt-config'
9+
command: 'apt-config'
10+
args: ['dump']
11+
expectedOutput: ['APT::AutoRemove']
12+
- name: 'path'
13+
command: 'sh'
14+
args: ['-c', 'echo $PATH']
15+
expectedOutput: ['/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin']
16+
fileContentTests:
17+
- name: 'Debian Sources'
18+
excludedContents: ['.*gce_debian_mirror.*']
19+
expectedContents: ['.*ports\.ubuntu\.com.*']
20+
path: '/etc/apt/sources.list'
21+
- name: 'Passwd file'
22+
expectedContents: ['root:x:0:0:root:/root:/bin/bash']
23+
path: '/etc/passwd'
24+
fileExistenceTests:
25+
- name: 'Root'
26+
path: '/'
27+
shouldExist: true
28+
uid: 0
29+
gid: 0
30+
- name: 'Date'
31+
path: '/bin/date'
32+
isExecutableBy: 'owner'
33+
- name: 'Hosts File'
34+
path: '/etc/hosts'
35+
shouldExist: true
36+
- name: 'Machine ID'
37+
path: '/etc/machine-id'
38+
- name: 'Dummy File'
39+
path: '/etc/dummy'
40+
shouldExist: false
41+
licenseTests:
42+
- debian: false
43+
files:
44+
- "/usr/share/doc/ubuntu-keyring/copyright"
45+
- "/usr/share/doc/dash/copyright"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
schemaVersion: '1.0.0'
2+
commandTests:
3+
- name: 'bad apt-get-command'
4+
command: ['apt-get', 'dslkfjasl']
5+
excludedError: ['.*FAIL.*']
6+
expectedOutput: ['.*Usage.*']
7+
- name: 'apt-config'
8+
command: ['apt-config', 'dump']
9+
expectedOutput: ['Acquire::Retries "3"']
10+
name: 'apt-config'
11+
- name: 'path'
12+
command: ['sh', '-c', 'echo $PATH']
13+
expectedOutput: ['/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin']
14+
fileContentTests:
15+
- name: 'Debian Sources'
16+
excludedContents: ['.*gce_debian_mirror.*']
17+
expectedContents: ['.*httpredir\.debian\.org.*']
18+
path: '/etc/apt/sources.list'
19+
- name: 'Wrong Retry Policy'
20+
expectedContents: ['Acquire::Retries 4;']
21+
path: '/etc/apt/apt.conf.d/apt-retry'
22+
fileExistenceTests:
23+
- name: 'Fake Dir'
24+
path: '/foo/bar'
25+
shouldExist: true
26+
- name: 'Wrong permissions'
27+
path: '/etc/apt/sources.list'
28+
permissions: '-rwxrwxrwx'
29+
shouldExist: true
30+
licenseTests:
31+
- debian: true
32+
files:
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
schemaVersion: '2.0.0' # Make sure to test the latest schema version
2+
metadataTest:
3+
env:
4+
- key: 'SOME_KEY'
5+
value: 'SOME_VAL'
6+
- key: 'EMPTY_VAR'
7+
value: ''
8+
- key: 'FOO_BAR'
9+
value: 'FOO\:BAR=BAZ'
10+
- key: 'REGEX_VAR'
11+
value: '[a-z]+-2\.1\.*'
12+
isRegex: true
13+
labels:
14+
- key: 'localnet.localdomain.commit_hash'
15+
value: '0123456789abcdef0123456789abcdef01234567'
16+
- key: 'localnet.my-domain.my-label'
17+
value: 'my .+ label'
18+
isRegex: true
19+
- key: 'label-with-empty-val'
20+
value: ''
21+
unexposedPorts: ['80']
22+
unmountedVolumes: ['/root']

tests/s390x/ubuntu_20_04_test.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
schemaVersion: '2.0.0' # Make sure to test the latest schema version
2+
commandTests:
3+
- name: 'apt-get'
4+
command: 'apt-get'
5+
args: ['help']
6+
excludedError: ['.*FAIL.*']
7+
expectedOutput: ['.*Usage.*']
8+
- name: 'apt-config'
9+
command: 'apt-config'
10+
args: ['dump']
11+
expectedOutput: ['APT::AutoRemove']
12+
- name: 'path'
13+
command: 'sh'
14+
args: ['-c', 'echo $PATH']
15+
expectedOutput: ['/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin']
16+
fileContentTests:
17+
- name: 'Debian Sources'
18+
excludedContents: ['.*gce_debian_mirror.*']
19+
expectedContents: ['.*ports\.ubuntu\.com.*']
20+
path: '/etc/apt/sources.list'
21+
- name: 'Passwd file'
22+
expectedContents: ['root:x:0:0:root:/root:/bin/bash']
23+
path: '/etc/passwd'
24+
fileExistenceTests:
25+
- name: 'Root'
26+
path: '/'
27+
shouldExist: true
28+
uid: 0
29+
gid: 0
30+
- name: 'Date'
31+
path: '/bin/date'
32+
isExecutableBy: 'owner'
33+
- name: 'Hosts File'
34+
path: '/etc/hosts'
35+
shouldExist: true
36+
- name: 'Machine ID'
37+
path: '/etc/machine-id'
38+
- name: 'Dummy File'
39+
path: '/etc/dummy'
40+
shouldExist: false
41+
licenseTests:
42+
- debian: false
43+
files:
44+
- "/usr/share/doc/ubuntu-keyring/copyright"
45+
- "/usr/share/doc/dash/copyright"

0 commit comments

Comments
 (0)