diff --git a/snap-overlay/templates/libvirtd.conf.j2 b/snap-overlay/templates/libvirtd.conf.j2 index e6621a0..8d701cd 100644 --- a/snap-overlay/templates/libvirtd.conf.j2 +++ b/snap-overlay/templates/libvirtd.conf.j2 @@ -19,7 +19,7 @@ # using this capability. # # This is enabled by default, uncomment this to disable it -#listen_tls = 0 +listen_tls = 0 # Listen for unencrypted TCP connections on the public TCP/IP port. # NB, must pass the --listen flag to the libvirtd process for this to @@ -30,7 +30,7 @@ # DIGEST_MD5 and GSSAPI (Kerberos5) # # This is disabled by default, uncomment this to enable it. -#listen_tcp = 1 +listen_tcp = 1 @@ -42,7 +42,7 @@ # Override the port for accepting insecure TCP connections # This can be a port number, or service name # -#tcp_port = "16509" +tcp_port = "16509" # Override the default configuration which binds to all network diff --git a/snapcraft.yaml b/snapcraft.yaml index d3cedd5..0e96547 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -409,7 +409,7 @@ apps: # Libvirt/Qemu libvirtd: - command: usr/sbin/libvirtd --pid $SNAP_DATA/libvirt.pid + command: usr/sbin/libvirtd --pid $SNAP_DATA/libvirt.pid --listen daemon: simple plugs: - network @@ -686,6 +686,7 @@ parts: - libsystemd0 - petname - python3 + - openssh-client - spice-html5 - sg3-utils # LIO userspace dependencies diff --git a/tests/test_cluster.py b/tests/test_cluster.py index 26c1561..13cddb8 100755 --- a/tests/test_cluster.py +++ b/tests/test_cluster.py @@ -128,15 +128,13 @@ class TestCluster(Framework): # Ping the instance ip = None - servers = compute_host.check_output([ + server = compute_host.check_output([ openstack_cmd, - 'server', 'list', '--format', 'json' + 'server', 'show', instance_name, '--format', 'json' ]).decode('utf-8') - servers = json.loads(servers) - for server in servers: - if server['Name'] == instance_name: - ip = server['Networks'].split(",")[1].strip() - break + server = json.loads(server) + ip = server['addresses'].split(",")[1].strip() + start_hypervisor = server['OS-EXT-SRV-ATTR:hypervisor_hostname'] self.assertTrue(ip) @@ -148,6 +146,23 @@ class TestCluster(Framework): wait_ping() + # Test live migration of the instance + compute_host.check_call([ + openstack_cmd, + 'server', 'migrate', '--live-migration', '--block-migration', + '--wait', instance_name + ]) + server = compute_host.check_output([ + openstack_cmd, + 'server', 'show', instance_name, '--format', 'json' + ]).decode('utf-8') + server = json.loads(server) + end_hypervisor = server['OS-EXT-SRV-ATTR:hypervisor_hostname'] + + self.assertNotEqual(start_hypervisor, end_hypervisor, + "Failed migration test. Start hypervisor is the " + "same as end hypervisor") + self.passed = True