Skip to content

Commit ac7505d

Browse files
committed
tests: Add centos 8; debian 10, 11; ubuntu 16.04, 18.04, 20.04 test images
1 parent 6bf58c3 commit ac7505d

File tree

9 files changed

+107
-3
lines changed

9 files changed

+107
-3
lines changed

tests/ansible/integration/runner/custom_binary_single_null.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,18 @@
1515
- "out.failed"
1616
- "out.results[0].failed"
1717
- "out.results[0].msg.startswith('MODULE FAILURE')"
18-
- "out.results[0].module_stdout.startswith('/bin/sh: ')"
18+
# On Ubuntu 16.04 /bin/sh is dash 0.5.8. It treats custom_binary_single_null
19+
# as a valid executable. There's no error message, and rc == 0.
1920
- |
20-
out.results[0].module_stdout.endswith('custom_binary_single_null: cannot execute binary file\r\n') or
21-
out.results[0].module_stdout.endswith('custom_binary_single_null: Exec format error\r\n')
21+
out.results[0].module_stdout.startswith('/bin/sh: ')
22+
or (ansible_facts.distribution == 'Ubuntu' and ansible_facts.distribution_version == '16.04')
23+
- |
24+
out.results[0].module_stdout.endswith((
25+
'custom_binary_single_null: cannot execute binary file\r\n',
26+
'custom_binary_single_null: Exec format error\r\n',
27+
'custom_binary_single_null: cannot execute binary file: Exec format error\r\n',
28+
))
29+
or (ansible_facts.distribution == 'Ubuntu' and ansible_facts.distribution_version == '16.04')
2230
2331
2432
# Can't test this: Mitogen returns 126, 2.5.x returns 126, 2.4.x discarded the

tests/image_prep/_container_setup.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,19 @@
4242
update_cache: true
4343
when: ansible_pkg_mgr == 'yum'
4444

45+
- name: Ensure requisite dnf packages are installed
46+
dnf:
47+
name: "{{ common_packages + packages }}"
48+
state: present
49+
update_cache: true
50+
when: ansible_pkg_mgr == 'dnf'
51+
4552
- name: Clean up package cache
4653
vars:
4754
clean_command:
4855
apt: apt-get clean
4956
yum: yum clean all
57+
dnf: dnf clean all
5058
command: "{{ clean_command[ansible_pkg_mgr] }}"
5159
args:
5260
warn: false
@@ -58,6 +66,11 @@
5866
- /var/lib/apt/lists
5967
when: ansible_pkg_mgr == 'apt'
6068

69+
- name: Configure /usr/bin/python
70+
command: alternatives --set python /usr/bin/python3.8
71+
args:
72+
creates: /usr/bin/python
73+
when: inventory_hostname in ["centos8"]
6174

6275
- name: Enable UTF-8 locale on Debian
6376
copy:
@@ -173,6 +186,15 @@
173186
regexp: '.*session.*required.*pam_loginuid.so'
174187
line: session optional pam_loginuid.so
175188

189+
# Normally this would be removed by systemd-networkd-wait-online. If
190+
# present ssh works only for root. The message displayed is
191+
# > System is booting up. Unprivileged users are not permitted to log in
192+
# > yet. Please come back later. For technical details, see pam_nologin(8).
193+
- name: Remove login lockout
194+
file:
195+
path: /run/nologin
196+
state: absent
197+
176198
- name: Install convenience script for running an straced Python
177199
copy:
178200
mode: 'u+rwx,go=rx'
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
bootstrap_packages: [python3]
2+
3+
docker_base: centos:8
4+
5+
packages:
6+
- perl-JSON
7+
- python2-virtualenv
8+
- python3-virtualenv
9+
- python36
10+
- python38
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
bootstrap_packages: [python]
2+
3+
docker_base: debian:10
4+
5+
packages:
6+
- libjson-perl
7+
- locales
8+
- python-virtualenv
9+
- python3
10+
- python3-virtualenv
11+
- virtualenv
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
bootstrap_packages: [python3, python3-apt]
2+
3+
docker_base: debian:bullseye
4+
5+
packages:
6+
- libjson-perl
7+
- locales
8+
- python-is-python3
9+
- python2
10+
- python3-virtualenv
11+
- virtualenv
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
bootstrap_packages: [python]
2+
3+
docker_base: ubuntu:16.04
4+
5+
packages:
6+
- libjson-perl
7+
- locales
8+
- python-virtualenv
9+
- python3
10+
- python3-virtualenv
11+
- virtualenv
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
bootstrap_packages: [python]
2+
3+
docker_base: ubuntu:18.04
4+
5+
packages:
6+
- libjson-perl
7+
- locales
8+
- python-virtualenv
9+
- python3
10+
- python3-virtualenv
11+
- virtualenv
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
bootstrap_packages: [python3]
2+
3+
docker_base: ubuntu:20.04
4+
5+
packages:
6+
- libjson-perl
7+
- locales
8+
- python-is-python3
9+
- python2
10+
- python3-virtualenv
11+
- virtualenv

tests/image_prep/hosts.ini

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[all:children]
22
centos
33
debian
4+
ubuntu
45

56
[all:vars]
67
ansible_connection = docker
@@ -9,6 +10,14 @@ ansible_connection = docker
910
centos5
1011
centos6
1112
centos7
13+
centos8
1214

1315
[debian]
1416
debian9
17+
debian10
18+
debian11
19+
20+
[ubuntu]
21+
ubuntu1604
22+
ubuntu1804
23+
ubuntu2004

0 commit comments

Comments
 (0)