tests: adjust dom0_update tests for dnf in VM
There is no support for 'copy_local' repository option, so setup test repository over http. Related to QubesOS/qubes-issues#1574
This commit is contained in:
parent
767d1f0074
commit
e87da9ec9d
@ -39,8 +39,7 @@ class TC_00_Dom0UpgradeMixin(qubes.tests.SystemTestsMixin):
|
|||||||
Tests for downloading dom0 updates using VMs based on different templates
|
Tests for downloading dom0 updates using VMs based on different templates
|
||||||
"""
|
"""
|
||||||
pkg_name = 'qubes-test-pkg'
|
pkg_name = 'qubes-test-pkg'
|
||||||
dom0_update_common_opts = ['--disablerepo=*', '--enablerepo=test',
|
dom0_update_common_opts = ['--disablerepo=*', '--enablerepo=test']
|
||||||
'--setopt=test.copy_local=1']
|
|
||||||
update_flag_path = '/var/lib/qubes/updates/dom0-updates-available'
|
update_flag_path = '/var/lib/qubes/updates/dom0-updates-available'
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -85,9 +84,9 @@ Expire-Date: 0
|
|||||||
p.stdin.write('''
|
p.stdin.write('''
|
||||||
[test]
|
[test]
|
||||||
name = Test
|
name = Test
|
||||||
baseurl = file:///tmp/repo
|
baseurl = http://localhost:8080/
|
||||||
enabled = 1
|
enabled = 1
|
||||||
''')
|
''')
|
||||||
p.stdin.close()
|
p.stdin.close()
|
||||||
p.wait()
|
p.wait()
|
||||||
|
|
||||||
@ -115,6 +114,7 @@ enabled = 1
|
|||||||
subprocess.check_call(['sudo', 'rpm', '--import',
|
subprocess.check_call(['sudo', 'rpm', '--import',
|
||||||
os.path.join(self.tmpdir, 'pubkey.asc')])
|
os.path.join(self.tmpdir, 'pubkey.asc')])
|
||||||
self.updatevm.start()
|
self.updatevm.start()
|
||||||
|
self.repo_running = False
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
self.qc.lock_db_for_writing()
|
self.qc.lock_db_for_writing()
|
||||||
@ -186,6 +186,13 @@ Test package
|
|||||||
elif retcode != 0:
|
elif retcode != 0:
|
||||||
self.skipTest("createrepo failed with code {}, cannot perform the "
|
self.skipTest("createrepo failed with code {}, cannot perform the "
|
||||||
"test".format(retcode))
|
"test".format(retcode))
|
||||||
|
self.start_repo()
|
||||||
|
|
||||||
|
def start_repo(self):
|
||||||
|
if not self.repo_running:
|
||||||
|
self.updatevm.run("cd /tmp/repo &&"
|
||||||
|
"python -m SimpleHTTPServer 8080")
|
||||||
|
self.repo_running = True
|
||||||
|
|
||||||
def test_000_update(self):
|
def test_000_update(self):
|
||||||
"""Dom0 update tests
|
"""Dom0 update tests
|
||||||
|
Loading…
Reference in New Issue
Block a user