Permalink
Browse files

OS-1752 / joyent/smartos-live#144 fixed regression with setting vnc_p…

…ort=-1
  • Loading branch information...
1 parent cdac1f3 commit 8debf6e19081c396249207cda8bd82135cf6c18e @joshwilsdon joshwilsdon committed Dec 10, 2012
Showing with 38 additions and 0 deletions.
  1. +8 −0 src/vm/node_modules/VM.js
  2. +30 −0 src/vm/tests/test-update-kvm.js

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -582,6 +582,36 @@ test('update max_locked_memory', function(t) {
});
});
+// setting vnc_port=-1 should disable VNC
+test('set vnc_port=-1', function(t) {
+ var test_value;
+
+ VM.load(vm_uuid, function (err, before_obj) {
+ if (err) {
+ t.ok(false, 'error loading existing VM: ' + err.message);
+ t.end();
+ return;
+ }
+ VM.update(vm_uuid, {'vnc_port': -1}, function(err) {
+ if (err) {
+ t.ok(false, 'error updating VM: ' + err.message);
+ t.end();
+ } else {
+ VM.load(vm_uuid, function (err, obj) {
+ if (err) {
+ t.ok(false, 'failed reloading VM');
+ t.end();
+ return;
+ }
+ t.ok((obj.vnc_port === -1), 'vm.vnc_port: ' + obj.vnc_port
+ + ' expected: ' + -1);
+ t.end();
+ });
+ }
+ });
+ });
+});
+
function zfs(args, callback)
{
var cmd = '/usr/sbin/zfs';

0 comments on commit 8debf6e

Please sign in to comment.