Skip to content

Commit 2b4b72b

Browse files
committed
updated test case
Signed-off-by: Jeromy Cannon <[email protected]>
1 parent 9ea29bc commit 2b4b72b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test/e2e/core/k8_e2e.test.mjs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,21 +176,21 @@ describe('K8', () => {
176176
it('should be able to copy a file to and from a container', async () => {
177177
const pods = await k8.waitForPodReady([`app=${podLabelValue}`], 1, 20)
178178
expect(pods.length).toStrictEqual(1)
179-
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'k8-'))
180-
const destDir = '/tmp'
181-
const srcPath = 'test/data/pem/keys/a-private-node0.pem'
182-
const destPath = `${destDir}/a-private-node0.pem`
179+
const localTmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'k8-test'))
180+
const remoteTmpDir = '/tmp'
181+
const localFilePath = 'test/data/pem/keys/a-private-node0.pem'
182+
const remoteFilePath = `${remoteTmpDir}/a-private-node0.pem`
183183

184184
// upload the file
185-
await expect(k8.copyTo(podName, containerName, srcPath, destDir)).resolves.toBeTruthy()
185+
await expect(k8.copyTo(podName, containerName, localFilePath, remoteTmpDir)).resolves.toBeTruthy()
186186

187187
// download the same file
188-
await expect(k8.copyFrom(podName, containerName, destPath, tmpDir)).resolves.toBeTruthy()
188+
await expect(k8.copyFrom(podName, containerName, remoteFilePath, localTmpDir)).resolves.toBeTruthy()
189189

190190
// rm file inside the container
191-
await expect(k8.execContainer(podName, containerName, ['rm', '-f', destPath])).resolves
191+
await expect(k8.execContainer(podName, containerName, ['rm', '-f', remoteFilePath])).resolves
192192

193-
fs.rmdirSync(tmpDir, { recursive: true })
193+
fs.rmdirSync(localTmpDir, { recursive: true })
194194
}, defaultTimeout)
195195

196196
it('should be able to port forward gossip port', (done) => {

0 commit comments

Comments
 (0)