update images for integration tests to ubuntu 22.04
This commit is contained in:
parent
726cd5c01a
commit
8f90fa9d86
3 changed files with 4 additions and 15 deletions
12
Dockerfile
12
Dockerfile
|
@ -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
|
|
@ -17,7 +17,7 @@ class UbuntuPlusUser(private val userName: String = "testuser") : DockerImage {
|
|||
|
||||
override fun imageText(): String {
|
||||
return """
|
||||
FROM ubuntu:20.04
|
||||
FROM ubuntu:22.04
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
|
|
|
@ -103,7 +103,8 @@ internal class UbuntuProvTest {
|
|||
|
||||
// then
|
||||
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 {
|
||||
return """
|
||||
FROM ubuntu:18.04
|
||||
FROM ubuntu:22.04
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
|
|
Loading…
Reference in a new issue