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
|
||||
"""
|
||||
pkg_name = 'qubes-test-pkg'
|
||||
dom0_update_common_opts = ['--disablerepo=*', '--enablerepo=test',
|
||||
'--setopt=test.copy_local=1']
|
||||
dom0_update_common_opts = ['--disablerepo=*', '--enablerepo=test']
|
||||
update_flag_path = '/var/lib/qubes/updates/dom0-updates-available'
|
||||
|
||||
@classmethod
|
||||
@ -85,9 +84,9 @@ Expire-Date: 0
|
||||
p.stdin.write('''
|
||||
[test]
|
||||
name = Test
|
||||
baseurl = file:///tmp/repo
|
||||
baseurl = http://localhost:8080/
|
||||
enabled = 1
|
||||
''')
|
||||
''')
|
||||
p.stdin.close()
|
||||
p.wait()
|
||||
|
||||
@ -115,6 +114,7 @@ enabled = 1
|
||||
subprocess.check_call(['sudo', 'rpm', '--import',
|
||||
os.path.join(self.tmpdir, 'pubkey.asc')])
|
||||
self.updatevm.start()
|
||||
self.repo_running = False
|
||||
|
||||
def tearDown(self):
|
||||
self.qc.lock_db_for_writing()
|
||||
@ -186,6 +186,13 @@ Test package
|
||||
elif retcode != 0:
|
||||
self.skipTest("createrepo failed with code {}, cannot perform the "
|
||||
"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):
|
||||
"""Dom0 update tests
|
||||
|
Loading…
Reference in New Issue
Block a user