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