update images for integration tests to ubuntu 22.04

This commit is contained in:
ansgarz 2024-05-24 11:23:47 +02:00
parent 726cd5c01a
commit 8f90fa9d86
3 changed files with 4 additions and 15 deletions

View file

@ -1,12 +0,0 @@
FROM ubuntu:latest
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get -y install apt-utils adduser sudo
RUN useradd -m testuser && echo "testuser:testuserpw" | chpasswd && adduser testuser sudo
RUN echo "testuser ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/testuser
USER testuser
CMD /bin/bash
WORKDIR /home/testuser

View file

@ -17,7 +17,7 @@ class UbuntuPlusUser(private val userName: String = "testuser") : DockerImage {
override fun imageText(): String { override fun imageText(): String {
return """ return """
FROM ubuntu:20.04 FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive ARG DEBIAN_FRONTEND=noninteractive

View file

@ -103,7 +103,8 @@ internal class UbuntuProvTest {
// then // then
assertFalse(result.success) assertFalse(result.success)
assertEquals("sudo: no tty present and no askpass program specified\n", result.err) val expectedMsg = "a password is required"
assertTrue(result.err?.contains(expectedMsg) ?: false, "Error: [$expectedMsg] is not found in [${result.err}]")
} }
} }
@ -119,7 +120,7 @@ class UbuntuUserNeedsPasswordForSudo(private val userName: String = "testuser")
override fun imageText(): String { override fun imageText(): String {
return """ return """
FROM ubuntu:18.04 FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive ARG DEBIAN_FRONTEND=noninteractive