F: include/qemu/userfaultfd.h
F: migration/
F: scripts/vmstate-static-checker.py
-F: tests/functional/test_migration.py
+F: tests/functional/*migration.py
F: tests/vmstate-static-checker-data/
F: tests/qtest/migration/
F: tests/qtest/migration-*
]
tests_aarch64_system_quick = [
- 'migration',
+ 'aarch64_migration',
]
tests_aarch64_system_thorough = [
]
tests_alpha_system_quick = [
- 'migration',
+ 'alpha_migration',
]
tests_alpha_system_thorough = [
]
tests_arm_system_quick = [
- 'migration',
+ 'arm_migration',
]
tests_arm_system_thorough = [
]
tests_i386_system_quick = [
- 'migration',
+ 'i386_migration',
]
tests_i386_system_thorough = [
]
tests_ppc_system_quick = [
- 'migration',
+ 'ppc_migration',
'ppc_74xx',
]
]
tests_ppc64_system_quick = [
- 'migration',
+ 'ppc64_migration',
]
tests_ppc64_system_thorough = [
]
tests_riscv32_system_quick = [
- 'migration',
+ 'riscv32_migration',
'riscv_opensbi',
]
]
tests_riscv64_system_quick = [
- 'migration',
+ 'riscv64_migration',
'riscv_opensbi',
]
]
tests_sparc_system_quick = [
- 'migration',
+ 'sparc_migration',
]
tests_sparc_system_thorough = [
]
tests_sparc64_system_quick = [
- 'migration',
+ 'sparc64_migration',
]
tests_sparc64_system_thorough = [
tests_x86_64_system_quick = [
'cpu_queries',
'mem_addr_space',
- 'migration',
+ 'x86_64_migration',
'pc_cpu_hotplug_props',
'virtio_version',
'x86_cpu_model_versions',
-#!/usr/bin/env python3
+# SPDX-License-Identifier: GPL-2.0-or-later
#
-# Migration test
+# Migration test base class
#
# Copyright (c) 2019 Red Hat, Inc.
#
import tempfile
import time
-from qemu_test import QemuSystemTest, skipIfMissingCommands
+from qemu_test import QemuSystemTest, which
from qemu_test.ports import Ports
self.assertEqual(dst_vm.cmd('query-status')['status'], 'running')
self.assertEqual(src_vm.cmd('query-status')['status'],'postmigrate')
- def select_machine(self):
- target_machine = {
- 'aarch64': 'quanta-gsj',
- 'alpha': 'clipper',
- 'arm': 'npcm750-evb',
- 'i386': 'isapc',
- 'ppc': 'sam460ex',
- 'ppc64': 'mac99',
- 'riscv32': 'spike',
- 'riscv64': 'virt',
- 'sparc': 'SS-4',
- 'sparc64': 'sun4u',
- 'x86_64': 'microvm',
- }
- self.set_machine(target_machine[self.arch])
-
def do_migrate(self, dest_uri, src_uri=None):
- self.select_machine()
dest_vm = self.get_vm('-incoming', dest_uri, name="dest-qemu")
dest_vm.add_args('-nodefaults')
dest_vm.launch()
self.skipTest('Failed to find a free port')
return port
- def test_migration_with_tcp_localhost(self):
+ def migration_with_tcp_localhost(self):
with Ports() as ports:
dest_uri = 'tcp:localhost:%u' % self._get_free_port(ports)
self.do_migrate(dest_uri)
- def test_migration_with_unix(self):
+ def migration_with_unix(self):
with tempfile.TemporaryDirectory(prefix='socket_') as socket_path:
dest_uri = 'unix:%s/qemu-test.sock' % socket_path
self.do_migrate(dest_uri)
- @skipIfMissingCommands('ncat')
- def test_migration_with_exec(self):
+ def migration_with_exec(self):
+ if not which('ncat'):
+ self.skipTest('ncat is not available')
with Ports() as ports:
free_port = self._get_free_port(ports)
dest_uri = 'exec:ncat -l localhost %u' % free_port
src_uri = 'exec:ncat localhost %u' % free_port
self.do_migrate(dest_uri, src_uri)
-
-if __name__ == '__main__':
- QemuSystemTest.main()
--- /dev/null
+#!/usr/bin/env python3
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# aarch64 migration test
+
+from migration import MigrationTest
+
+
+class Aarch64MigrationTest(MigrationTest):
+
+ def test_migration_with_tcp_localhost(self):
+ self.set_machine('quanta-gsj')
+ self.migration_with_tcp_localhost()
+
+ def test_migration_with_unix(self):
+ self.set_machine('quanta-gsj')
+ self.migration_with_unix()
+
+ def test_migration_with_exec(self):
+ self.set_machine('quanta-gsj')
+ self.migration_with_exec()
+
+
+if __name__ == '__main__':
+ MigrationTest.main()
--- /dev/null
+#!/usr/bin/env python3
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# Alpha migration test
+
+from migration import MigrationTest
+
+
+class AlphaMigrationTest(MigrationTest):
+
+ def test_migration_with_tcp_localhost(self):
+ self.set_machine('clipper')
+ self.migration_with_tcp_localhost()
+
+ def test_migration_with_unix(self):
+ self.set_machine('clipper')
+ self.migration_with_unix()
+
+ def test_migration_with_exec(self):
+ self.set_machine('clipper')
+ self.migration_with_exec()
+
+
+if __name__ == '__main__':
+ MigrationTest.main()
--- /dev/null
+#!/usr/bin/env python3
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# arm migration test
+
+from migration import MigrationTest
+
+
+class ArmMigrationTest(MigrationTest):
+
+ def test_migration_with_tcp_localhost(self):
+ self.set_machine('npcm750-evb')
+ self.migration_with_tcp_localhost()
+
+ def test_migration_with_unix(self):
+ self.set_machine('npcm750-evb')
+ self.migration_with_unix()
+
+ def test_migration_with_exec(self):
+ self.set_machine('npcm750-evb')
+ self.migration_with_exec()
+
+
+if __name__ == '__main__':
+ MigrationTest.main()
--- /dev/null
+#!/usr/bin/env python3
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# i386 migration test
+
+from migration import MigrationTest
+
+
+class I386MigrationTest(MigrationTest):
+
+ def test_migration_with_tcp_localhost(self):
+ self.set_machine('isapc')
+ self.migration_with_tcp_localhost()
+
+ def test_migration_with_unix(self):
+ self.set_machine('isapc')
+ self.migration_with_unix()
+
+ def test_migration_with_exec(self):
+ self.set_machine('isapc')
+ self.migration_with_exec()
+
+
+if __name__ == '__main__':
+ MigrationTest.main()
--- /dev/null
+#!/usr/bin/env python3
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# ppc migration test
+
+from migration import MigrationTest
+
+
+class PpcMigrationTest(MigrationTest):
+
+ def test_migration_with_tcp_localhost(self):
+ self.set_machine('mac99')
+ self.migration_with_tcp_localhost()
+
+ def test_migration_with_unix(self):
+ self.set_machine('mac99')
+ self.migration_with_unix()
+
+ def test_migration_with_exec(self):
+ self.set_machine('mac99')
+ self.migration_with_exec()
+
+
+if __name__ == '__main__':
+ MigrationTest.main()
--- /dev/null
+#!/usr/bin/env python3
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# ppc migration test
+
+from migration import MigrationTest
+
+
+class PpcMigrationTest(MigrationTest):
+
+ def test_migration_with_tcp_localhost(self):
+ self.set_machine('sam460ex')
+ self.migration_with_tcp_localhost()
+
+ def test_migration_with_unix(self):
+ self.set_machine('sam460ex')
+ self.migration_with_unix()
+
+ def test_migration_with_exec(self):
+ self.set_machine('sam460ex')
+ self.migration_with_exec()
+
+
+if __name__ == '__main__':
+ MigrationTest.main()
--- /dev/null
+#!/usr/bin/env python3
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# riscv32 migration test
+
+from migration import MigrationTest
+
+
+class Rv32MigrationTest(MigrationTest):
+
+ def test_migration_with_tcp_localhost(self):
+ self.set_machine('spike')
+ self.migration_with_tcp_localhost()
+
+ def test_migration_with_unix(self):
+ self.set_machine('virt')
+ self.migration_with_unix()
+
+ def test_migration_with_exec(self):
+ self.set_machine('spike')
+ self.migration_with_exec()
+
+
+if __name__ == '__main__':
+ MigrationTest.main()
--- /dev/null
+#!/usr/bin/env python3
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# riscv64 migration test
+
+from migration import MigrationTest
+
+
+class Rv64MigrationTest(MigrationTest):
+
+ def test_migration_with_tcp_localhost(self):
+ self.set_machine('virt')
+ self.migration_with_tcp_localhost()
+
+ def test_migration_with_unix(self):
+ self.set_machine('spike')
+ self.migration_with_unix()
+
+ def test_migration_with_exec(self):
+ self.set_machine('virt')
+ self.migration_with_exec()
+
+
+if __name__ == '__main__':
+ MigrationTest.main()
--- /dev/null
+#!/usr/bin/env python3
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# Sparc64 migration test
+
+from migration import MigrationTest
+
+
+class Sparc64MigrationTest(MigrationTest):
+
+ def test_migration_with_tcp_localhost(self):
+ self.set_machine('sun4u')
+ self.migration_with_tcp_localhost()
+
+ def test_migration_with_unix(self):
+ self.set_machine('sun4u')
+ self.migration_with_unix()
+
+ def test_migration_with_exec(self):
+ self.set_machine('sun4u')
+ self.migration_with_exec()
+
+
+if __name__ == '__main__':
+ MigrationTest.main()
--- /dev/null
+#!/usr/bin/env python3
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# Sparc migration test
+
+from migration import MigrationTest
+
+
+class SparcMigrationTest(MigrationTest):
+
+ def test_migration_with_tcp_localhost(self):
+ self.set_machine('SS-4')
+ self.migration_with_tcp_localhost()
+
+ def test_migration_with_unix(self):
+ self.set_machine('SS-5')
+ self.migration_with_unix()
+
+ def test_migration_with_exec(self):
+ self.set_machine('SS-4')
+ self.migration_with_exec()
+
+
+if __name__ == '__main__':
+ MigrationTest.main()
--- /dev/null
+#!/usr/bin/env python3
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# x86_64 migration test
+
+from migration import MigrationTest
+
+
+class X8664MigrationTest(MigrationTest):
+
+ def test_migration_with_tcp_localhost(self):
+ self.set_machine('microvm')
+ self.migration_with_tcp_localhost()
+
+ def test_migration_with_unix(self):
+ self.set_machine('microvm')
+ self.migration_with_unix()
+
+ def test_migration_with_exec(self):
+ self.set_machine('microvm')
+ self.migration_with_exec()
+
+
+if __name__ == '__main__':
+ MigrationTest.main()