test: fix dockerproxy

This commit is contained in:
Girish Ramakrishnan
2024-12-19 13:10:14 +01:00
parent 17fee93002
commit 5898436638

View File

@@ -28,6 +28,8 @@ async function exec(cmd) {
});
}
const BASE_IMAGE = 'registry.docker.com/cloudron/base:4.2.0@sha256:46da2fffb36353ef714f97ae8e962bd2c212ca091108d768ba473078319a47f4';
describe('Dockerproxy', function () {
let containerId;
const { setup, cleanup } = common;
@@ -38,7 +40,7 @@ describe('Dockerproxy', function () {
await syslogServer.start();
await dockerProxy.start();
const stdout = await exec(`${DOCKER} run -d ${infra.images.base} "bin/bash" "-c" "while true; do echo 'perpetual walrus'; sleep 1; done"`);
const stdout = await exec(`${DOCKER} run -d ${BASE_IMAGE} "bin/bash" "-c" "while true; do echo 'perpetual walrus'; sleep 1; done"`);
containerId = stdout.slice(0, -1); // removes the trailing \n
});
@@ -59,13 +61,13 @@ describe('Dockerproxy', function () {
});
it('can create container', async function () {
const cmd = `${DOCKER} run ${infra.images.base} "/bin/bash" "-c" "echo 'hello'"`;
const cmd = `${DOCKER} run ${BASE_IMAGE} "/bin/bash" "-c" "echo 'hello'"`;
const stdout = await exec(cmd);
expect(stdout).to.contain('hello');
});
it('proxy overwrites the container network option', async function () {
const cmd = `${DOCKER} run --network ifnotrewritethiswouldfail ${infra.images.base} "/bin/bash" "-c" "echo 'hello'"`;
const cmd = `${DOCKER} run --network ifnotrewritethiswouldfail ${BASE_IMAGE} "/bin/bash" "-c" "echo 'hello'"`;
const stdout = await exec(cmd);
expect(stdout).to.contain('hello');
});