diff --git a/src/test/kotlin/org/domaindrivenarchitecture/provs/syspec/infrastructure/VerificationKtTest.kt b/src/test/kotlin/org/domaindrivenarchitecture/provs/syspec/infrastructure/VerificationKtTest.kt index e1a7dec..ada979e 100644 --- a/src/test/kotlin/org/domaindrivenarchitecture/provs/syspec/infrastructure/VerificationKtTest.kt +++ b/src/test/kotlin/org/domaindrivenarchitecture/provs/syspec/infrastructure/VerificationKtTest.kt @@ -3,10 +3,7 @@ package org.domaindrivenarchitecture.provs.syspec.infrastructure import org.domaindrivenarchitecture.provs.framework.core.ProvResult import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.createDirs import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.createFile -import org.domaindrivenarchitecture.provs.syspec.domain.FileSpec -import org.domaindrivenarchitecture.provs.syspec.domain.FolderSpec -import org.domaindrivenarchitecture.provs.syspec.domain.SocketSpec -import org.domaindrivenarchitecture.provs.syspec.domain.SyspecConfig +import org.domaindrivenarchitecture.provs.syspec.domain.* import org.domaindrivenarchitecture.provs.test.defaultTestContainer import org.domaindrivenarchitecture.provs.test.tags.ContainerTest import org.domaindrivenarchitecture.provs.test.testLocal @@ -131,4 +128,30 @@ internal class VerificationKtTest { assertFalse(res3) } + @ContainerTest + fun test_verifySpecConfig_succeeds() { + // given + val dir = "/home/testuser" + val prov = defaultTestContainer() + + // when + val res = prov.verifySpecConfig(SyspecConfig(folder = listOf(FolderSpec(dir)), command = listOf(CommandSpec("echo bla")))) + + // then + assertTrue(res.success) + } + + @ContainerTest + fun test_verifySpecConfig_fails() { + // given + val dir = "/home/testuser" + val prov = defaultTestContainer() + + // when + val res = prov.verifySpecConfig(SyspecConfig(command = listOf(CommandSpec("echoo bla"), CommandSpec("echo bla")), folder = listOf(FolderSpec(dir)))) + + // then + assertFalse(res.success) + } + } \ No newline at end of file