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.
42 lines
1.4 KiB
Kotlin
42 lines
1.4 KiB
Kotlin
2 years ago
|
package org.domaindrivenarchitecture.provs.desktop.infrastructure
|
||
3 years ago
|
|
||
2 years ago
|
import org.domaindrivenarchitecture.provs.framework.core.getResourceAsText
|
||
3 years ago
|
import org.domaindrivenarchitecture.provs.test.defaultTestContainer
|
||
2 years ago
|
import org.domaindrivenarchitecture.provs.test.tags.ContainerTest
|
||
2 years ago
|
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
|
||
3 years ago
|
import org.junit.jupiter.api.Assertions.assertTrue
|
||
|
import org.junit.jupiter.api.Test
|
||
|
|
||
|
internal class DevOpsKtTest {
|
||
|
|
||
|
@Test
|
||
2 years ago
|
@ContainerTest
|
||
3 years ago
|
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"
|
||
|
)
|
||
|
)
|
||
|
}
|
||
|
}
|