@@ -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
6061describe ( 'busy box' , function ( ) {
6162 this . timeout ( 0 ) ;
0 commit comments