Copy verification files due to systemd machinectl limitations

This commit is contained in:
Mikhail Gordeev 2020-10-30 14:48:12 +03:00
parent 7d73dafdcf
commit 86277e0c43
2 changed files with 9 additions and 1 deletions

View File

@ -9,6 +9,7 @@ import fcntl
import logging
import os
import re
import shutil
import subprocess
import time
@ -698,9 +699,11 @@ Dir::Etc::preferencesparts "/var/empty";
cmd = [self.checksum_command] + files
self.info(f'Calculate checksum of {string}')
self.call(cmd, stdout_to_file=sum_file)
shutil.copyfile(sum_file, 'SHA256SUMS')
self.info(f'Sign checksum of {string}')
self.call(['gpg2', '--yes', '-basu', self.key, sum_file])
shutil.copyfile(sum_file + '.asc', 'SHA256SUMS.gpg')
def kick(self):
remote = self._remote

View File

@ -62,6 +62,11 @@ class TestIntegrationImages(TestCase):
def test_external_files(self):
self.assertIn('README', self.images['p9'])
def test_verification_files(self):
for images in self.images.values():
self.assertIn('SHA256SUMS', images)
self.assertIn('SHA256SUMS.gpg', images)
def test_number_of_images(self):
number_of_images = sum(len(self.images[b]) for b in self.images.keys())
self.assertEqual(number_of_images, 58)
self.assertEqual(number_of_images, 64)