Merge #232 Improve logging by adding subvariants

This commit is contained in:
Dennis Gilmore 2016-03-22 14:15:26 +00:00
commit 6230b0ff3e
4 changed files with 49 additions and 28 deletions

View file

@ -388,6 +388,7 @@ class TestCreateImageBuildThread(PungiTestCase):
'version': 'Rawhide',
'ksurl': 'git://git.fedorahosted.org/git/spin-kickstarts.git',
'distro': 'Fedora-20',
'subvariant': 'KDE',
}
},
"conf_file": 'amd64,x86_64-Client-Fedora-Docker-Base-docker',
@ -423,6 +424,19 @@ class TestCreateImageBuildThread(PungiTestCase):
with mock.patch('time.sleep'):
t.process((compose, cmd), 1)
self.assertItemsEqual(
koji_wrapper.get_image_build_cmd.call_args_list,
[mock.call(cmd['image_conf'],
conf_file_dest='amd64,x86_64-Client-Fedora-Docker-Base-docker',
scratch=False)]
)
self.assertItemsEqual(
koji_wrapper.run_blocking_cmd.call_args_list,
[mock.call(koji_wrapper.get_image_build_cmd.return_value,
log_file=self.topdir + '/logs/amd64-x86_64/imagebuild-Client-KDE-docker.amd64-x86_64.log')]
)
self.assertItemsEqual(
linker.mock_calls,
[mock.call('/koji/task/1235/Fedora-Docker-Base-20160103.amd64.qcow2',
@ -473,6 +487,7 @@ class TestCreateImageBuildThread(PungiTestCase):
data = image_relative_paths.pop(image.path)
self.assertEqual(data['format'], image.format)
self.assertEqual(data['type'], image.type)
self.assertEqual('KDE', image.subvariant)
self.assertTrue(os.path.isdir(self.topdir + '/compose/Client/amd64/images'))
self.assertTrue(os.path.isdir(self.topdir + '/compose/Client/x86_64/images'))

View file

@ -296,7 +296,7 @@ class TestLiveMediaThread(PungiTestCase):
'target': 'f24',
'title': None,
'version': 'Rawhide',
'subvariant': 'DATA',
'subvariant': 'KDE',
}
pool = mock.Mock()
@ -333,7 +333,7 @@ class TestLiveMediaThread(PungiTestCase):
self.assertEqual(
run_blocking_cmd.mock_calls,
[mock.call('koji-spin-livemedia',
log_file=self.topdir + '/logs/amd64-x86_64/livemedia-Server.amd64-x86_64.log')])
log_file=self.topdir + '/logs/amd64-x86_64/livemedia-Server-KDE.amd64-x86_64.log')])
self.assertEqual(get_live_media_cmd.mock_calls,
[mock.call({'arch': 'amd64,x86_64',
'ksfile': 'file.ks',
@ -375,7 +375,7 @@ class TestLiveMediaThread(PungiTestCase):
self.assertIn(image.path, image_relative_paths)
self.assertEqual('iso', image.format)
self.assertEqual('live', image.type)
self.assertEqual('DATA', image.subvariant)
self.assertEqual('KDE', image.subvariant)
@mock.patch('pungi.phases.livemedia_phase.KojiWrapper')
def test_handle_koji_fail(self, KojiWrapper):
@ -398,6 +398,7 @@ class TestLiveMediaThread(PungiTestCase):
'target': 'f24',
'title': None,
'version': 'Rawhide',
'subvariant': 'KDE',
}
pool = mock.Mock()
@ -437,6 +438,7 @@ class TestLiveMediaThread(PungiTestCase):
'target': 'f24',
'title': None,
'version': 'Rawhide',
'subvariant': 'KDE',
}
pool = mock.Mock()