ostree: Use --touch-if-changed

There are three different cases:

 * we expect commitid and it's there
 * we expect commitid and it's missing
 * we don't expect commitid

This patch helps differentiate between the second two. In former one we
should report an error and mark the phase as failed. The latter is
perfectly fine and no error should be reported

Fixes: https://pagure.io/pungi/issue/1046
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2018-09-13 15:50:22 +02:00
parent 93bc843682
commit 36c347eb79
5 changed files with 30 additions and 14 deletions

View file

@ -48,6 +48,7 @@ class OstreeTreeScriptTest(helpers.PungiTestCase):
run.call_args_list,
[mock.call(['rpm-ostree', 'compose', 'tree', '--repo=%s' % repo,
'--write-commitid-to=%s' % (self.topdir + '/logs/Atomic/commitid.log'),
'--touch-if-changed=%s.stamp' % (self.topdir + '/logs/Atomic/commitid.log'),
self.topdir + '/fedora-atomic-docker-host.json'],
logfile=self.topdir + '/logs/Atomic/create-ostree-repo.log', show_cmd=True, stdout=True)])
@ -90,6 +91,7 @@ class OstreeTreeScriptTest(helpers.PungiTestCase):
run.call_args_list,
[mock.call(['rpm-ostree', 'compose', 'tree', '--repo=%s' % repo,
'--write-commitid-to=%s' % (self.topdir + '/logs/Atomic/commitid.log'),
'--touch-if-changed=%s.stamp' % (self.topdir + '/logs/Atomic/commitid.log'),
self.topdir + '/fedora-atomic-docker-host.json'],
logfile=self.topdir + '/logs/Atomic/create-ostree-repo.log', show_cmd=True, stdout=True)])
@ -110,6 +112,7 @@ class OstreeTreeScriptTest(helpers.PungiTestCase):
run.call_args_list,
[mock.call(['rpm-ostree', 'compose', 'tree', '--repo=%s' % repo,
'--write-commitid-to=%s' % (self.topdir + '/logs/Atomic/commitid.log'),
'--touch-if-changed=%s.stamp' % (self.topdir + '/logs/Atomic/commitid.log'),
self.topdir + '/fedora-atomic-docker-host.json'],
logfile=self.topdir + '/logs/Atomic/create-ostree-repo.log', show_cmd=True, stdout=True),
mock.call(['ostree', 'summary', '-u', '--repo=%s' % repo],
@ -132,6 +135,7 @@ class OstreeTreeScriptTest(helpers.PungiTestCase):
run.call_args_list,
[mock.call(['rpm-ostree', 'compose', 'tree', '--repo=%s' % repo,
'--write-commitid-to=%s' % (self.topdir + '/logs/Atomic/commitid.log'),
'--touch-if-changed=%s.stamp' % (self.topdir + '/logs/Atomic/commitid.log'),
'--add-metadata-string=version=24',
self.topdir + '/fedora-atomic-docker-host.json'],
logfile=self.topdir + '/logs/Atomic/create-ostree-repo.log', show_cmd=True, stdout=True)])
@ -219,6 +223,7 @@ class OstreeTreeScriptTest(helpers.PungiTestCase):
run.call_args_list,
[mock.call(['rpm-ostree', 'compose', 'tree', '--repo=%s' % repo,
'--write-commitid-to=%s' % (self.topdir + '/logs/Atomic/commitid.log'),
'--touch-if-changed=%s.stamp' % (self.topdir + '/logs/Atomic/commitid.log'),
'--force-nocache',
self.topdir + '/fedora-atomic-docker-host.json'],
logfile=self.topdir + '/logs/Atomic/create-ostree-repo.log', show_cmd=True, stdout=True)])