@@ -43,56 +43,56 @@ describe('docker', function () {
4343 // });
4444 //});
4545
46- it ( 'command info should pass' , function ( done ) {
47- var docker = new Docker ( {
48- //machinename: config.DockerMachineName
49- } ) ;
50- //console.log('docker', docker);
51- assert . isNotNull ( docker ) ;
52- var failed = false ;
53- var err = null ;
54- docker . command ( 'info' ) . then ( function ( data ) {
55- //console.log('data = ', data);
56- assert . isNotNull ( data ) ;
57- //}).catch(function (error) {
58- // assert.isNotNull(error);
59- // err = error;
60- // failed = true;
61- // console.log('error = ', error);
62- } ) . finally ( function ( ) {
63- //console.log('finally ');
64- assert . isFalse ( failed ) ;
65- assert . isNull ( err ) ;
66- done ( ) ;
67- } ) ;
68- } ) ;
46+ // it('command info should pass', function (done) {
47+ // var docker = new Docker({
48+ // //machinename: config.DockerMachineName
49+ // });
50+ // //console.log('docker', docker);
51+ // assert.isNotNull(docker);
52+ // var failed = false;
53+ // var err = null;
54+ // docker.command('info').then(function (data) {
55+ // //console.log('data = ', data);
56+ // assert.isNotNull(data);
57+ // // }).catch(function (error) {
58+ // // assert.isNotNull(error);
59+ // // err = error;
60+ // // failed = true;
61+ // // console.log('error = ', error);
62+ // }).finally(function () {
63+ // //console.log('finally ');
64+ // assert.isFalse(failed);
65+ // assert.isNull(err);
66+ // done();
67+ // });
68+ // });
6969
7070
71- it ( 'command build should pass' , function ( done ) {
72- this . timeout ( 15000 ) ;
73- var docker = new Docker ( {
74- machinename : config . DockerMachineName ,
75- cwd : path . join ( __dirname , 'nginx' )
76- } ) ;
77- //console.log('docker', docker);
78- assert . isNotNull ( docker ) ;
79- var failed = false ;
80- var err = null ;
81- docker . command ( 'build -t nginximg1 .' ) . then ( function ( data ) {
82- //console.log('data = ', data);
83- assert . isNotNull ( data ) ;
84- } ) . catch ( function ( error ) {
85- assert . isNotNull ( error ) ;
86- err = error ;
87- failed = true ;
88- //console.log('error = ', error);
89- } ) . finally ( function ( ) {
90- //console.log('finally ');
91- assert . isFalse ( failed ) ;
92- assert . isNull ( err ) ;
93- done ( ) ;
94- } ) ;
95- } ) ;
71+ // it('command build should pass', function (done) {
72+ // this.timeout(15000);
73+ // var docker = new Docker({
74+ // machinename: config.DockerMachineName,
75+ // cwd: path.join(__dirname, 'nginx')
76+ // });
77+ // //console.log('docker', docker);
78+ // assert.isNotNull(docker);
79+ // var failed = false;
80+ // var err = null;
81+ // docker.command('build -t nginximg1 .').then(function (data) {
82+ // //console.log('data = ', data);
83+ // assert.isNotNull(data);
84+ // }).catch(function (error) {
85+ // assert.isNotNull(error);
86+ // err = error;
87+ // failed = true;
88+ // //console.log('error = ', error);
89+ // }).finally(function () {
90+ // //console.log('finally ');
91+ // assert.isFalse(failed);
92+ // assert.isNull(err);
93+ // done();
94+ // });
95+ // });
9696
9797
9898 //it('command build with callback', function (done) {
@@ -110,32 +110,58 @@ describe('docker', function () {
110110 // });
111111 //});
112112
113- it ( 'command run' , function ( done ) {
114- this . timeout ( 15000 ) ;
115- var docker = new Docker ( {
116- machinename : config . DockerMachineName ,
117- } ) ;
118- //console.log('docker', docker);
119- assert . isNotNull ( docker ) ;
120- var failed = false ;
121- var err = null ;
122- docker . command ( 'run --name nginxcont -d -p 80:80 nginximg1' ) . then ( function ( data ) {
123- console . log ( 'data = ' , data ) ;
124- assert . isNotNull ( data ) ;
125- } ) . catch ( function ( error ) {
126- assert . isNotNull ( error ) ;
127- err = error ;
128- failed = true ;
129- console . log ( 'error = ' , error ) ;
130- } ) . finally ( function ( ) {
131- console . log ( 'finally ' ) ;
132- assert . isFalse ( failed ) ;
133- assert . isNull ( err ) ;
134- done ( ) ;
135- } ) ;
136- } ) ;
113+ //it('command run', function (done) {
114+ // this.timeout(15000);
115+ // var docker = new Docker({
116+ // machinename: config.DockerMachineName,
117+ // });
118+ // //console.log('docker', docker);
119+ // assert.isNotNull(docker);
120+ // var failed = false;
121+ // var err = null;
122+ // docker.command('run --name nginxcont -d -p 80:80 nginximg1').then(function (data) {
123+ // console.log('data = ', data);
124+ // assert.isNotNull(data);
125+ // }).catch(function (error) {
126+ // assert.isNotNull(error);
127+ // err = error;
128+ // failed = true;
129+ // console.log('error = ', error);
130+ // }).finally(function () {
131+ // console.log('finally ');
132+ // assert.isFalse(failed);
133+ // assert.isNull(err);
134+ // done();
135+ // });
136+ //});
137+
138+ //it('command ps', function (done) {
139+ // this.timeout(15000);
140+ // var docker = new Docker({
141+ // //machinename: config.DockerMachineName,
142+ // });
143+ // //console.log('docker', docker);
144+ // assert.isNotNull(docker);
145+ // var failed = false;
146+ // var err = null;
147+ // docker.command('ps').then(function (data) {
148+ // console.log('data = ', data);
149+ // assert.isNotNull(data);
150+ // }).catch(function (error) {
151+ // assert.isNotNull(error);
152+ // err = error;
153+ // failed = true;
154+ // console.log('error = ', error);
155+ // }).finally(function () {
156+ // console.log('finally ');
157+ // assert.isFalse(failed);
158+ // assert.isNull(err);
159+ // done();
160+ // });
161+ //});
162+
137163
138- it ( 'command ps ' , function ( done ) {
164+ it ( 'command images ' , function ( done ) {
139165 this . timeout ( 15000 ) ;
140166 var docker = new Docker ( {
141167 //machinename: config.DockerMachineName,
@@ -144,7 +170,7 @@ describe('docker', function () {
144170 assert . isNotNull ( docker ) ;
145171 var failed = false ;
146172 var err = null ;
147- docker . command ( 'ps ' ) . then ( function ( data ) {
173+ docker . command ( 'images ' ) . then ( function ( data ) {
148174 console . log ( 'data = ' , data ) ;
149175 assert . isNotNull ( data ) ;
150176 } ) . catch ( function ( error ) {
@@ -160,7 +186,6 @@ describe('docker', function () {
160186 } ) ;
161187 } ) ;
162188
163-
164189} ) ;
165190
166191
0 commit comments