You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
provs/src/test/kotlin/org/domaindrivenarchitecture/provs/desktop/infrastructure/DevOpsKtTest.kt

42 lines
1.4 KiB
Kotlin

package org.domaindrivenarchitecture.provs.desktop.infrastructure
import org.domaindrivenarchitecture.provs.framework.core.getResourceAsText
import org.domaindrivenarchitecture.provs.test.defaultTestContainer
import org.domaindrivenarchitecture.provs.test.tags.ContainerTest
import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.createDir
import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.createDirs
import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.fileContainsText
import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.Test
internal class DevOpsKtTest {
@Test
@ContainerTest
fun installKubectlAndTools() {
// given
defaultTestContainer().def {
createDirs("/etc/bash_completion.d", sudo = true)
createDir(".bashrc.d")
}
//when
val res = defaultTestContainer().installKubectlAndTools()
// then
assertTrue(res.success)
assertTrue(
defaultTestContainer().fileContainsText(
"~/.bashrc.d/kubectl.sh",
getResourceAsText("workplace/infrastructure/kubectl.sh")
)
)
assertTrue(
defaultTestContainer().fileContainsText(
"/etc/bash_completion.d/kubernetes",
"\nkubectl completion bash\n"
)
)
}
}