Skip to content

Commit

Permalink
functional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
apocas committed Apr 5, 2020
1 parent f4957e3 commit 8216b94
Showing 1 changed file with 34 additions and 9 deletions.
43 changes: 34 additions & 9 deletions test/firefracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,51 @@ describe('#firecracker', function () {
var rootImg = 'https://s3.amazonaws.com/spec.ccfc.min/img/hello/fsfiles/hello-rootfs.ext4';

return firecracker.downloadImage(kernelImg, os.tmpdir() + '/hello-vmlinux.bin').then(function () {
console.log('Kernel image downloaded!');
return firecracker.downloadImage(rootImg, os.tmpdir() + '/hello-rootfs.ext4');
}).then(function () {
console.log('Filesystem image downloaded!');
}).catch(function (err) {
console.log(err);
expect(err).to.be.null;
});
});

it('should get info', function() {
return firecracker.info().then(function(data) {
console.log(data);
it('should use load the kernel image', function () {
return firecracker.bootSource({
'kernel_image_path': os.tmpdir() + '/hello-vmlinux.bin',
'boot_args': 'console=ttyS0 reboot=k panic=1 pci=off'
}).then(function () {
}).catch(function (err) {
expect(err).to.be.null;
});
});

it('should use load the filesystem image', function () {
var drive = firecracker.drive('rootfs');
return drive.updatePreboot({
'path_on_host': os.tmpdir() + '/hello-rootfs.ext4',
'is_root_device': true,
'is_read_only': false
}).then(function () {
}).catch(function (err) {
expect(err).to.be.null;
});
});
});

describe('#firestarter', function () {
it('should get info', function () {
return firecracker.info().then(function (data) {
expect(data).to.be.ok;
}, function(err) {
console.log(err);
}).catch(function (err) {
expect(err).to.be.null;
});
});

it('should start microvm', function () {
return firecracker.action('InstanceStart').then(function () {
}).catch(function (err) {
expect(err).to.be.null;
});
});

});

});

0 comments on commit 8216b94

Please sign in to comment.