Skip to content

Commit

Permalink
Switch to Alpine 3.8 (#366)
Browse files Browse the repository at this point in the history
  • Loading branch information
gunhu authored and philpep committed Sep 1, 2018
1 parent 110acf4 commit 074e809
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions images/alpine_35/Dockerfile → images/alpine_38/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM alpine:3.5
FROM alpine:3.8

RUN apk add --update --no-cache python openrc openssh && rm /var/cache/apk/* && \
RUN apk add --update --no-cache python openrc openssh && \
sed -i "s/^#PermitRootLogin prohibit-password/PermitRootLogin without-password/g" /etc/ssh/sshd_config && \
rm -f /etc/ssh/ssh_host_ecdsa_key /etc/ssh/ssh_host_rsa_key && \
ssh-keygen -q -N "" -t dsa -f /etc/ssh/ssh_host_ecdsa_key && \
Expand Down
4 changes: 2 additions & 2 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def has_docker():
"""

DOCKER_IMAGES = [
"alpine_35",
"alpine_38",
"archlinux",
"centos_6",
"centos_7",
Expand Down Expand Up @@ -207,7 +207,7 @@ def host(request, tmpdir_factory):
"centos_6",
"centos_7",
"fedora",
"alpine_35",
"alpine_38",
"archlinux"
)

Expand Down
16 changes: 8 additions & 8 deletions test/test_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
all_images = pytest.mark.testinfra_hosts(*[
"docker://{}".format(image)
for image in (
"alpine_35", "archlinux", "centos_6", "centos_7",
"alpine_38", "archlinux", "centos_6", "centos_7",
"debian_stretch", "fedora", "ubuntu_xenial"
)
])
Expand All @@ -32,14 +32,14 @@
@all_images
def test_package(host, docker_image):
assert not host.package('zsh').is_installed
if docker_image in ("alpine_35", "archlinux"):
if docker_image in ("alpine_38", "archlinux"):
name = "openssh"
else:
name = "openssh-server"

ssh = host.package(name)
version = {
"alpine_35": "7.",
"alpine_38": "7.",
"archlinux": "7.",
"centos_6": "5.",
"centos_7": "7.",
Expand All @@ -50,7 +50,7 @@ def test_package(host, docker_image):
assert ssh.is_installed
assert ssh.version.startswith(version)
release = {
"alpine_35": "r1",
"alpine_38": "r3",
"archlinux": None,
"centos_6": ".el6",
"centos_7": ".el7",
Expand Down Expand Up @@ -90,7 +90,7 @@ def test_systeminfo(host, docker_image):
assert host.system_info.type == "linux"

release, distribution, codename = {
"alpine_35": ("^3\.5\.", "alpine", None),
"alpine_38": ("^3\.8\.", "alpine", None),
"archlinux": ("rolling", "arch", None),
"centos_6": (r"^6", "CentOS", None),
"centos_7": ("^7$", "centos", None),
Expand All @@ -107,7 +107,7 @@ def test_systeminfo(host, docker_image):
@all_images
def test_ssh_service(host, docker_image):
if docker_image in ("centos_6", "centos_7", "fedora",
"alpine_35", "archlinux"):
"alpine_38", "archlinux"):
name = "sshd"
else:
name = "ssh"
Expand Down Expand Up @@ -199,13 +199,13 @@ def test_socket(host):
def test_process(host, docker_image):
init = host.process.get(pid=1)
assert init.ppid == 0
if docker_image != "alpine_35":
if docker_image != "alpine_38":
# busybox ps doesn't have a euid equivalent
assert init.euid == 0
assert init.user == "root"

args, comm = {
"alpine_35": ("/sbin/init", "init"),
"alpine_38": ("/sbin/init", "init"),
"archlinux": ("/usr/sbin/init", "systemd"),
"centos_6": ("/usr/sbin/sshd -D", "sshd"),
"centos_7": ("/usr/sbin/init", "systemd"),
Expand Down

0 comments on commit 074e809

Please sign in to comment.