Ejemplo n.º 1
0
 def _create_server(self):
     name = self.name_generate(prefix='server')
     server = self.client.servers.create(name, self.image, self.flavor)
     shell._poll_for_status(self.client.servers.get, server.id, 'building',
                            ['active'])
     self.addCleanup(server.delete)
     return server
 def test_trigger_crash_dump_in_paused_state(self):
     server = self._create_server()
     self.wait_for_server_os_boot(server.id)
     self.nova("pause %s " % server.id)
     shell._poll_for_status(self.client.servers.get, server.id, "active", ["paused"])
     self.nova("trigger-crash-dump %s " % server.id)
     self._assert_nmi(server.id)
 def test_trigger_crash_dump_in_resized_state(self):
     server = self._create_server()
     self.wait_for_server_os_boot(server.id)
     self.nova("resize %s %s" % (server.id, "m1.small"))
     shell._poll_for_status(self.client.servers.get, server.id, "active", ["verify_resize"])
     self.nova("trigger-crash-dump %s " % server.id)
     self._assert_nmi(server.id)
Ejemplo n.º 4
0
 def test_trigger_crash_dump_in_resized_state(self):
     server = self._create_server()
     self.wait_for_server_os_boot(server.id)
     self.nova('resize %s %s' % (server.id, 'm1.small'))
     shell._poll_for_status(self.client.servers.get, server.id, 'active',
                            ['verify_resize'])
     self.nova('trigger-crash-dump %s ' % server.id)
     self._assert_nmi(server.id)
 def _create_server(self):
     name = self.name_generate(prefix='server')
     server = self.client.servers.create(name, self.image, self.flavor)
     shell._poll_for_status(
         self.client.servers.get, server.id,
         'building', ['active'])
     self.addCleanup(server.delete)
     return server
Ejemplo n.º 6
0
 def test_trigger_crash_dump_in_paused_state(self):
     server = self._create_server()
     self.wait_for_server_os_boot(server.id)
     self.nova('pause %s ' % server.id)
     shell._poll_for_status(self.client.servers.get, server.id, 'active',
                            ['paused'])
     self.nova('trigger-crash-dump %s ' % server.id)
     self._assert_nmi(server.id)
 def test_trigger_crash_dump_in_paused_state(self):
     server = self._create_server()
     self.wait_for_server_os_boot(server.id)
     self.nova('pause %s ' % server.id)
     shell._poll_for_status(
         self.client.servers.get, server.id,
         'active', ['paused'])
     self.nova('trigger-crash-dump %s ' % server.id)
     self._wait_for_nmi(server.id)
Ejemplo n.º 8
0
 def test_trigger_crash_dump_in_error_state(self):
     server = self._create_server()
     self.wait_for_server_os_boot(server.id)
     self.nova('reset-state %s ' % server.id)
     shell._poll_for_status(
         self.client.servers.get, server.id,
         'active', ['error'])
     self.nova('trigger-crash-dump %s ' % server.id)
     self._wait_for_nmi(server.id)
Ejemplo n.º 9
0
    def _create_servers(self, name, number):
        network = self.client.networks.list()[0]
        servers = []
        for i in range(number):
            servers.append(self.client.servers.create(name, self.image, self.flavor, nics=[{"net-id": network.id}]))
            shell._poll_for_status(self.client.servers.get, servers[-1].id, "building", ["active"])

            self.addCleanup(servers[-1].delete)
        return servers
 def test_trigger_crash_dump_in_error_state(self):
     server = self._create_server()
     self.wait_for_server_os_boot(server.id)
     self.nova('reset-state %s ' % server.id)
     shell._poll_for_status(
         self.client.servers.get, server.id,
         'active', ['error'])
     self.nova('trigger-crash-dump %s ' % server.id)
     self._assert_nmi(server.id)
 def test_trigger_crash_dump_in_resized_state(self):
     server = self._create_server()
     self.wait_for_server_os_boot(server.id)
     self.nova('resize %s %s' % (server.id, 'm1.small'))
     shell._poll_for_status(
         self.client.servers.get, server.id,
         'active', ['verify_resize'])
     self.nova('trigger-crash-dump %s ' % server.id)
     self._assert_nmi(server.id)
Ejemplo n.º 12
0
 def _create_server(self):
     name = self.name_generate(prefix='server')
     network = self.client.networks.list()[0]
     server = self.client.servers.create(
         name, self.image, self.flavor, nics=[{"net-id": network.id}])
     shell._poll_for_status(
         self.client.servers.get, server.id,
         'building', ['active'])
     self.addCleanup(server.delete)
     return server
 def _create_server(self):
     name = self.name_generate(prefix='server')
     network = self.client.networks.list()[0]
     server = self.client.servers.create(
         name, self.image, self.flavor, nics=[{"net-id": network.id}])
     shell._poll_for_status(
         self.client.servers.get, server.id,
         'building', ['active'])
     self.addCleanup(server.delete)
     return server
Ejemplo n.º 14
0
 def test_rebuild(self):
     # Add a description to the tests that rebuild a server
     server, descr = self._boot_server_with_description()
     descr = "New description for rebuilt VM."
     self.nova("rebuild --description '%s' %s %s" %
               (descr, server.id, self.image.name))
     shell._poll_for_status(self.client.servers.get, server.id, 'rebuild',
                            ['active'])
     output = self.nova("show %s" % server.id)
     self.assertEqual(descr,
                      self._get_value_from_the_table(output, "description"))
 def test_trigger_crash_dump_in_resized_state(self):
     server = self._create_server()
     self.wait_for_server_os_boot(server.id)
     self.nova('resize %s %s' % (server.id, 'm1.small'))
     shell._poll_for_status(
         self.client.servers.get, server.id,
         'active', ['verify_resize'])
     self.nova('trigger-crash-dump %s ' % server.id)
     self._wait_for_nmi(server.id)
     output = self.nova('console-log %s ' % server.id)
     self.assertIn("Uhhuh. NMI received for unknown reason ", output)
 def test_trigger_crash_dump_in_shutoff_state(self):
     server = self._create_server()
     self.wait_for_server_os_boot(server.id)
     self.nova("stop %s " % server.id)
     shell._poll_for_status(self.client.servers.get, server.id, "active", ["shutoff"])
     output = self.nova("trigger-crash-dump %s " % server.id, fail_ok=True, merge_stderr=True)
     self.assertIn(
         "ERROR (Conflict): "
         "Cannot 'trigger_crash_dump' instance %s "
         "while it is in vm_state stopped (HTTP 409) " % server.id,
         output,
     )
 def test_trigger_crash_dump_in_paused_state(self):
     server = self._create_server()
     self.wait_for_server_os_boot(server.id)
     self.nova('pause %s ' % server.id)
     shell._poll_for_status(
         self.client.servers.get, server.id,
         'active', ['paused'])
     self.nova('trigger-crash-dump %s ' % server.id)
     self._wait_for_nmi(server.id)
     output = self.nova('console-log %s ' % server.id)
     # In PAUSED state a server's kernel shouldn't react onto NMI
     self.assertNotIn("Uhhuh. NMI received for unknown reason ", output)
Ejemplo n.º 18
0
    def _create_servers(self, name, number):
        network = self.client.networks.list()[0]
        servers = []
        for i in range(number):
            servers.append(self.client.servers.create(
                name, self.image, self.flavor, nics=[{"net-id": network.id}]))
            shell._poll_for_status(
                self.client.servers.get, servers[-1].id,
                'building', ['active'])

            self.addCleanup(servers[-1].delete)
        return servers
Ejemplo n.º 19
0
 def test_rebuild(self):
     # Add a description to the tests that rebuild a server
     server, descr = self._boot_server_with_description()
     descr = "New description for rebuilt VM."
     self.nova("rebuild --description '%s' %s %s" %
               (descr, server.id, self.image.name))
     shell._poll_for_status(
         self.client.servers.get, server.id,
         'rebuild', ['active'])
     output = self.nova("show %s" % server.id)
     self.assertEqual(descr, self._get_value_from_the_table(output,
                                                            "description"))
Ejemplo n.º 20
0
 def _create_server_and_attach_volume(self):
     name = self.name_generate(prefix='server')
     server = self.client.servers.create(name, self.image, self.flavor)
     self.addCleanup(server.delete)
     shell._poll_for_status(self.client.servers.get, server.id, 'building',
                            ['active'])
     volume = self.client.volumes.create(1)
     self.addCleanup(self.nova, 'volume-delete', params=volume.id)
     self.wait_for_volume_status(volume, 'available')
     self.nova('volume-attach', params="%s %s" % (name, volume.id))
     self.addCleanup(self._release_volume, server, volume)
     self.wait_for_volume_status(volume, 'in-use')
     return server, volume
Ejemplo n.º 21
0
 def test_trigger_crash_dump_in_shutoff_state(self):
     server = self._create_server()
     self.wait_for_server_os_boot(server.id)
     self.nova('stop %s ' % server.id)
     shell._poll_for_status(self.client.servers.get, server.id, 'active',
                            ['shutoff'])
     output = self.nova('trigger-crash-dump %s ' % server.id,
                        fail_ok=True,
                        merge_stderr=True)
     self.assertIn(
         "ERROR (Conflict): "
         "Cannot 'trigger_crash_dump' instance %s "
         "while it is in vm_state stopped (HTTP 409) " % server.id, output)
 def _create_server_and_attach_volume(self):
     name = self.name_generate(prefix='server')
     server = self.client.servers.create(name, self.image, self.flavor)
     self.addCleanup(server.delete)
     shell._poll_for_status(
         self.client.servers.get, server.id,
         'building', ['active'])
     volume = self.client.volumes.create(1)
     self.addCleanup(self.nova, 'volume-delete', params=volume.id)
     self.wait_for_volume_status(volume, 'available')
     self.nova('volume-attach', params="%s %s" % (name, volume.id))
     self.addCleanup(self._release_volume, server, volume)
     self.wait_for_volume_status(volume, 'in-use')
     return server, volume