branch initial commit

This commit is contained in:
az 2023-01-18 09:10:19 +01:00
parent bf436bf846
commit 6537058ecf
2 changed files with 22 additions and 1 deletions

View file

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

View file

@ -3,6 +3,7 @@ package org.domaindrivenarchitecture.provs.desktop.domain
import org.domaindrivenarchitecture.provs.desktop.infrastructure.getConfig import org.domaindrivenarchitecture.provs.desktop.infrastructure.getConfig
import org.domaindrivenarchitecture.provs.framework.core.remote import org.domaindrivenarchitecture.provs.framework.core.remote
import org.domaindrivenarchitecture.provs.test.defaultTestContainer import org.domaindrivenarchitecture.provs.test.defaultTestContainer
import org.domaindrivenarchitecture.provs.test.tags.ContainerTest
import org.domaindrivenarchitecture.provs.test.tags.ExtensiveContainerTest import org.domaindrivenarchitecture.provs.test.tags.ExtensiveContainerTest
import org.junit.jupiter.api.Assertions.assertTrue import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Disabled
@ -10,6 +11,24 @@ import org.junit.jupiter.api.Test
internal class DesktopServiceKtTest { internal class DesktopServiceKtTest {
@ContainerTest
fun provisionLocalDesktop_fails_if_user_cannot_sudo_without_password() {
// given
val prov =
// when
// in order to test DesktopType.OFFICE: fix installing libreoffice for a fresh container as it hangs the first time but succeeds 2nd time
val res = prov.provisionDesktop(
DesktopType.BASIC,
gitUserName = "testuser",
gitEmail = "testuser@test.org",
onlyModules = null
)
// then
assertTrue(res.success)
}
@ExtensiveContainerTest @ExtensiveContainerTest
fun provisionDesktop() { fun provisionDesktop() {
// given // given