Permalink
Browse files

OS-1755 add test case for non-vmadm snapshots to ensure this is exerc…

…ised in the future.
  • Loading branch information...
1 parent c406b0a commit ddf692e35ef45c487b64a2bcab6ef0594356662a @joshwilsdon joshwilsdon committed Dec 10, 2012
Showing with 28 additions and 0 deletions.
  1. +28 −0 src/vm/tests/test-snapshots.js
@@ -258,6 +258,34 @@ test('create normal zone', {'timeout': 240000}, function(t) {
});
});
+test('create snapshot without vmsnap name and it should not show up', {'timeout': 240000}, function(t) {
+
+ var dataset = vmobj.zfs_filesystem;
+ var snapshot = dataset + '@manual-snapshot';
+
+ execFile('/usr/sbin/zfs', ['snapshot', snapshot], function (error) {
+ t.ok(!error, 'created manual snapshot' + (error ? ': ' + error.message : ''));
+ if (!error) {
+ execFile('/usr/sbin/zfs', ['list', '-t', 'snapshot', snapshot], function (err) {
+ t.ok(!err, 'manual snapshot exists' + (err ? ': ' + err.message : ''));
+ if (!err) {
+ VM.load(vmobj.uuid, function (e, o) {
+ t.ok(!e, 'reload VM after snap' + (e ? ': ' + e.message : ''));
+ if (!e) {
+ t.ok(o.snapshots.length === 0, 'have ' + o.snapshots.length + ' snapshots, expected: 0');
+ }
+ t.end();
+ });
+ } else {
+ t.end();
+ }
+ });
+ } else {
+ t.end();
+ }
+ });
+});
+
// try to create bad snapshot names
function createBadSnapshot(t, uuid, name, callback)

0 comments on commit ddf692e

Please sign in to comment.