mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Add e2e test for registry over http
This commit is contained in:
parent
8ed2330a3c
commit
d2c155afee
2 changed files with 51 additions and 0 deletions
|
|
@ -60,6 +60,26 @@ export class DockerTestContainer {
|
|||
}
|
||||
}
|
||||
|
||||
dockerExec(command, daemon = false) {
|
||||
if (!this.isRunning) {
|
||||
throw new Error("Container is not running");
|
||||
}
|
||||
|
||||
try {
|
||||
const dockerExecCommand = `docker exec ${daemon ? "-d " : " "}${
|
||||
this.containerName
|
||||
} bash -c "${command}"`;
|
||||
const output = execSync(dockerExecCommand, {
|
||||
encoding: "utf-8",
|
||||
stdio: "pipe",
|
||||
timeout: 10000,
|
||||
});
|
||||
return output;
|
||||
} catch (error) {
|
||||
throw new Error(`Failed to execute command: ${error.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
async openShell(shell) {
|
||||
let ptyProcess = pty.spawn(
|
||||
"docker",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue