Skip to content

Commit 1646d8c

Browse files
Move integration tests to new folder.
1 parent 14626b6 commit 1646d8c

39 files changed

+285
-244
lines changed

test/acpipowerbutton.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

test/acpisleepbutton.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

test/exec.js

Lines changed: 0 additions & 26 deletions
This file was deleted.

test/export.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

test/getextradata.js

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'use strict';
2+
3+
const virtualbox = require('../../lib/virtualbox'),
4+
vmName = 'node-virtualbox-test-machine';
5+
6+
virtualbox.acpipowerbutton(vmName, function (error) {
7+
if (error) {
8+
throw error;
9+
}
10+
});
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'use strict';
2+
3+
var virtualbox = require('../../lib/virtualbox'),
4+
args = process.argv.slice(2);
5+
6+
virtualbox.acpisleepbutton(args[0], function (error) {
7+
if (error) {
8+
throw error;
9+
}
10+
});

test/integration/exec.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
'use strict';
2+
3+
var virtualbox = require('../../lib/virtualbox'),
4+
args = process.argv.slice(2),
5+
vm = args[0],
6+
user = args[1],
7+
pass = args[2],
8+
ostype = virtualbox.guestproperty.os(vm),
9+
path;
10+
11+
if (ostype === 'windows') {
12+
path = 'C:\\Program Files\\Internet Explorer\\iexplore.exe';
13+
} else if (ostype === 'mac') {
14+
path = 'Safari.app';
15+
} else {
16+
path = 'whoami';
17+
}
18+
19+
virtualbox.start(vm, function () {
20+
virtualbox.exec(
21+
{
22+
vm: vm,
23+
user: user,
24+
passwd: pass,
25+
path: path,
26+
params: [args[1] || 'http://google.com'],
27+
},
28+
function (error, stdout) {
29+
if (error) {
30+
throw error;
31+
}
32+
console.log(stdout);
33+
}
34+
);
35+
});

test/integration/export.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'use strict';
2+
3+
var virtualbox = require('../../lib/virtualbox'),
4+
args = process.argv.slice(2);
5+
6+
virtualbox.export(args[0], args[1], function (error) {
7+
if (error) {
8+
throw error;
9+
}
10+
});

test/integration/getextradata.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
'use strict';
2+
3+
var virtualbox = require('../../lib/virtualbox'),
4+
args = process.argv.slice(2);
5+
6+
virtualbox.extradata.get({ vm: args[0], key: args[1] }, function (
7+
error,
8+
value
9+
) {
10+
if (error) {
11+
throw error;
12+
}
13+
14+
console.log(
15+
'Virtual Machine "%s" extra "%s" value is "%s"',
16+
args[0],
17+
args[1],
18+
value
19+
);
20+
});

0 commit comments

Comments
 (0)