Exemplo n.º 1
0
Arquivo: tests.py Projeto: herlo/tunir
 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')
Exemplo n.º 2
0
Arquivo: tests.py Projeto: herlo/tunir
 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())