def test_download_initrd_kernel(self, s_call): """ Tests the initrd and kernel extraction. """ create_initrd_kernel() result= testvm.download_initrd_and_kernel('/tmp/test_tunir/test.qcow2', '/tmp/test_tunir') self.assertEqual(result['kernel'], '/tmp/test_tunir/test-vmlinuz') self.assertEqual(result['initrd'], '/tmp/test_tunir/test-initramfs')
def test_download_initrd_kernel_exception(self, s_call): """ Tests the initrd and kernel extraction. """ testvm.clean_dirs('/tmp/test_tunir') create_initrd_kernel(missing=True) with captured_output() as (out, err): result= testvm.download_initrd_and_kernel('/tmp/test_tunir/test.qcow2', '/tmp/test_tunir') self.assertIn("Unable to find kernel or initrd, did they download?", out.getvalue())