From e7c2c73907e6d70ca3d0176079c406c2183284f5 Mon Sep 17 00:00:00 2001 From: ansgarz Date: Fri, 28 Jan 2022 23:39:33 +0100 Subject: [PATCH] correct test_createFile_in_container --- .../ubuntu/filesystem/base/FilesystemKtTest.kt | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/filesystem/base/FilesystemKtTest.kt b/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/filesystem/base/FilesystemKtTest.kt index 986b80c..9d6a5b4 100644 --- a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/filesystem/base/FilesystemKtTest.kt +++ b/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/filesystem/base/FilesystemKtTest.kt @@ -1,6 +1,5 @@ package org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base -import org.domaindrivenarchitecture.provs.framework.core.getResourceAsText import org.domaindrivenarchitecture.provs.test.defaultTestContainer import org.domaindrivenarchitecture.provs.test.tags.ContainerTest import org.domaindrivenarchitecture.provs.test.testLocal @@ -40,22 +39,18 @@ internal class FilesystemKtTest { @ContainerTest fun test_createFile_in_container() { // given - val prov = testLocal() //defaultTestContainer() - val filename = "tmp/testfile11" - - val testtext = getResourceAsText("org/domaindrivenarchitecture/provs/infrastructure/k3s/" + "cert-manager.yaml") - - println("aaaaaaaaaaaaaaaaaa len: " + testtext.length) + val prov = defaultTestContainer() + val filename = "testfile8" // when - val res = prov.createFile(filename, testtext, overwriteIfExisting = true) -// val res2 = prov.createFile("sudo$filename", testtext, sudo = true) + val res = prov.createFile(filename, testtext) + val res2 = prov.createFile("sudo$filename", testtext, sudo = true) // then assertTrue(res.success) -// assertTrue(res2.success) + assertTrue(res2.success) assertEquals(testtext, prov.fileContent(filename)) -// assertEquals(testtext, prov.fileContent("sudo$filename")) + assertEquals(testtext, prov.fileContent("sudo$filename")) } @Test