Fix race condition in test_challenge_build (APKINDEX timestamp)

This commit is contained in:
Oliver Smith 2017-07-10 21:28:15 +02:00
parent 51bdc24315
commit 0bd1d54049
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 8 additions and 6 deletions

View File

@ -52,15 +52,17 @@ def test_challenge_build(args):
version = apkbuild["pkgver"] + "-r" + apkbuild["pkgrel"]
temp_path = pmb.chroot.other.tempfolder(args, "/tmp/test_challenge_build/" +
args.arch_native)
apk_path = ("/home/user/packages/user/" + args.arch_native + "/" + pkgname +
"-" + version + ".apk")
pmb.chroot.user(args, ["cp", apk_path, apk_path +
".buildinfo.json", temp_path])
packages_path = "/home/user/packages/user/" + args.arch_native
apk_path = packages_path + "/" + pkgname + "-" + version + ".apk"
pmb.chroot.user(args, ["cp", apk_path, apk_path + ".buildinfo.json",
temp_path])
# Change the timestamps of all files, so the changes file gets written
# correctly, even if this testcase gets executed very fast
pmb.chroot.user(args, ["touch", "-d", "2017-01-01", apk_path, apk_path +
".buildinfo.json"])
pmb.chroot.user(args, ["touch", "-d", "2017-01-01",
packages_path + "/APKINDEX.tar.gz",
apk_path,
apk_path + ".buildinfo.json"])
# Challenge, output changes into a file
setattr(args, "output_repo_changes", args.work + "/chroot_native/tmp/"