From c5052ce4834d9addc69cb961bb4c3e8bca8d126f Mon Sep 17 00:00:00 2001 From: ansgarz Date: Fri, 28 Jan 2022 17:46:19 +0100 Subject: [PATCH] fix test --- .../provs/server/infrastructure/NetworkKtTest.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/kotlin/org/domaindrivenarchitecture/provs/server/infrastructure/NetworkKtTest.kt b/src/test/kotlin/org/domaindrivenarchitecture/provs/server/infrastructure/NetworkKtTest.kt index 14831ee..9589c0c 100644 --- a/src/test/kotlin/org/domaindrivenarchitecture/provs/server/infrastructure/NetworkKtTest.kt +++ b/src/test/kotlin/org/domaindrivenarchitecture/provs/server/infrastructure/NetworkKtTest.kt @@ -1,5 +1,6 @@ package org.domaindrivenarchitecture.provs.server.infrastructure +import org.domaindrivenarchitecture.provs.framework.core.processors.ContainerStartMode import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.createDirs import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.fileContainsText import org.domaindrivenarchitecture.provs.framework.ubuntu.install.base.aptInstall @@ -15,7 +16,7 @@ internal class NetworkKtTest { @ContainerTest fun test_provisionNetwork() { // given - val p = defaultTestContainer() + val p = defaultTestContainer(ContainerStartMode.CREATE_NEW_KILL_EXISTING) p.task { aptInstall("dbus netplan.io") createDirs("/etc/netplan", sudo = true) @@ -23,12 +24,13 @@ internal class NetworkKtTest { } // when - val res = p.provisionNetwork() + val res = p.provisionNetwork( "192.168.5.1", loopbackIpv6 = "fc00::5:1") // then // assertTrue(res.success) -- netplan is not working in an unprivileged container - see also https://askubuntu.com/questions/813588/systemctl-failed-to-connect-to-bus-docker-ubuntu16-04-container // check file content snippet + assertTrue(res.success) assertTrue(p.fileContainsText("/etc/netplan/99-loopback.yaml", content = "- 192.168.5.1/32", sudo = true)) } } \ No newline at end of file