test: adjust to device-qemu-amd64 move to main (!1910)

Don't assume that the device selected in "pmbootstrap init" is in the
testing subdir anymore. The default device, qemu-amd64, was recently
moved to main, so this does not hold up anymore. Instead, use
pmb.helpers.pmaports.find to figure out the currect dir.
This commit is contained in:
Oliver Smith 2020-04-11 18:40:11 +02:00
parent 44bd235f3e
commit 8dc8daa05a
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
2 changed files with 5 additions and 4 deletions

View File

@ -385,8 +385,8 @@ def test_build_local_source_high_level(args, tmpdir):
aports = tmpdir + "/aports"
aport = aports + "/device/testing/device-" + args.device
os.makedirs(aport)
shutil.copy(args.aports + "/device/testing/device-" + args.device + "/deviceinfo",
aport)
path_original = pmb.helpers.pmaports.find(args, f"device-{args.device}")
shutil.copy(f"{path_original}/deviceinfo", aport)
# aports: Add modified hello-world aport (source="", uses $builddir)
aport = aports + "/main/hello-world"

View File

@ -80,8 +80,9 @@ def setup_work(args, tmpdir):
for folder in ["device/testing", "main"]:
pmb.helpers.run.user(args, ["mkdir", "-p", args.aports, tmpdir +
"/_aports/" + folder])
pmb.helpers.run.user(args, ["cp", "-r", args.aports + "/device/testing/device-" +
args.device, tmpdir + "/_aports/device/testing"])
path_original = pmb.helpers.pmaports.find(args, f"device-{args.device}")
pmb.helpers.run.user(args, ["cp", "-r", path_original,
f"{tmpdir}/_aports/device/testing"])
for pkgname in ["testlib", "testapp", "testsubpkg"]:
pmb.helpers.run.user(args, ["cp", "-r",
"test/testdata/pkgrel_bump/aports/" + pkgname,