Skip to content

Commit ff7a1ed

Browse files
committed
Update README.md
1 parent 76a9707 commit ff7a1ed

2 files changed

Lines changed: 24 additions & 22 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ curl https://raw.githubusercontent.com/davidkhala/linux-utils/main/apps/docker/i
1010

1111
## Refs
1212
- [container in general](https://github.com/davidkhala/containers)
13+
- [Docker Kubernetes](https://github.com/davidkhala/k8s/blob/master/docker.sh)
1314
- Docker cli tools
1415
- [For linux](https://github.com/davidkhala/linux-utils/tree/main/apps/docker)

nodejs/test/containerTest.js

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,32 +30,33 @@ describe('hello-world', function () {
3030
});
3131

3232
});
33-
if (!(process.env.CI && os.platform() === 'win32')) {
3433

35-
describe('fabric-tools', function () {
36-
this.timeout(0);
34+
describe('run command', function () {
35+
this.timeout(0);
36+
if (os.platform() === 'win32') {
37+
return;
38+
}
39+
it('fabric-tools: command in lasting container', async () => {
3740
const imageName = 'hyperledger/fabric-tools';
3841
const containerName = 'cli';
39-
before(async () => {
40-
await manager.imagePull(imageName);
41-
const containerOptsBuilder = new ContainerOptsBuilder(imageName, ['cat']);
42-
containerOptsBuilder.name = containerName;
43-
containerOptsBuilder.tty = true;
44-
const {opts} = containerOptsBuilder;
45-
opts.AttachStdin = true;
46-
opts.AttachStdout = true;
47-
48-
await manager.containerStart(opts);
49-
});
50-
it('container exec', async () => {
51-
const result = await manager.containerExec(containerName, {Cmd: ['echo', 'x']});
52-
assert.equal(result, 'x\n');
53-
});
54-
after(async () => {
55-
await manager.containerDelete(containerName);
56-
});
42+
await manager.imagePull(imageName);
43+
const containerOptsBuilder = new ContainerOptsBuilder(imageName, ['cat']);
44+
containerOptsBuilder.name = containerName;
45+
containerOptsBuilder.tty = true;
46+
const {opts} = containerOptsBuilder;
47+
opts.AttachStdin = true;
48+
opts.AttachStdout = true;
49+
await manager.containerStart(opts);
50+
// run
51+
52+
const result = await manager.containerExec(containerName, {Cmd: ['echo', 'x']});
53+
assert.equal(result, 'x\n');
54+
// cleanup
55+
await manager.containerDelete(containerName);
5756
});
58-
}
57+
58+
});
59+
5960

6061
describe('busy box', function () {
6162
this.timeout(0);

0 commit comments

Comments
 (0)