[atomic] Add a script to create ostree repo
This is a wrapper over ostree and rpm-ostree. It is intended to be run in either Koji or Mock chroot. Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
6230b0ff3e
commit
282058dafe
3 changed files with 104 additions and 0 deletions
38
tests/test_atomic_script.py
Executable file
38
tests/test_atomic_script.py
Executable file
|
|
@ -0,0 +1,38 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
import unittest
|
||||
import mock
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'bin'))
|
||||
|
||||
from tests import helpers
|
||||
from pungi import atomic
|
||||
|
||||
|
||||
class OstreeScriptTest(helpers.PungiTestCase):
|
||||
|
||||
@mock.patch('kobo.shortcuts.run')
|
||||
def test_full_run(self, run):
|
||||
atomic.main([
|
||||
'--log-dir={}'.format(os.path.join(self.topdir, 'logs', 'Atomic')),
|
||||
'--treefile={}'.format(os.path.join(self.topdir, 'work', 'fedora-atomic-docker-host.json')),
|
||||
os.path.join(self.topdir, 'atomic'),
|
||||
])
|
||||
self.maxDiff = None
|
||||
self.assertItemsEqual(
|
||||
run.call_args_list,
|
||||
[mock.call(['ostree', 'init', '--repo={}/atomic'.format(self.topdir), '--mode=archive-z2'],
|
||||
log_file=self.topdir + '/logs/Atomic/init-atomic-repo.log'),
|
||||
mock.call(['rpm-ostree', 'compose', 'tree', '--repo={}/atomic'.format(self.topdir),
|
||||
self.topdir + '/work/fedora-atomic-docker-host.json'],
|
||||
log_file=self.topdir + '/logs/Atomic/create-atomic-repo.log')])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue