Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vmcheck fixes #698

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions tests/vmcheck/multitest.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,12 @@ def flush(self):
rc = self._p.wait()

# just merge the two files
with open("vmcheck/%s.out" % self.test) as f:
with open("vmcheck/%s.log" % self.test, 'a') as j:
j.write(f.read())
os.remove("vmcheck/%s.out" % self.test)
outfile = "vmcheck/{}.out".format(self.test)
if os.path.isfile(outfile):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a hack! I think that makes sense. If test.sh failed even before writing to the log file, opening will fail.

with open(outfile) as f:
with open("vmcheck/%s.log" % self.test, 'a') as j:
j.write(f.read())
os.remove(outfile)

rcs = "PASS" if rc == 0 else ("FAIL (rc %d)" % rc)
print("%s: %s" % (rcs, self.test))
Expand Down
16 changes: 4 additions & 12 deletions tests/vmcheck/overlay.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,11 @@ fi
cd /ostree/repo/tmp
rm vmcheck -rf
ostree checkout $commit vmcheck --fsync=0
# ✀✀✀ BEGIN hack for https://github.com/projectatomic/rpm-ostree/pull/693 ✀✀✀
rm -f vmcheck/usr/etc/{.pwd.lock,passwd-,group-,shadow-,gshadow-,subuid-,subgid-}
# ✀✀✀ END hack for https://github.com/projectatomic/rpm-ostree/pull/693 ✀✀✀
# Now, overlay our built binaries
rsync -rlv /var/roothome/sync/insttree/usr/ vmcheck/usr/
# ✀✀✀ BEGIN hack for https://github.com/projectatomic/rpm-ostree/pull/642 ✀✀✀
ostree admin unlock || true
for url in https://kojipkgs.fedoraproject.org//packages/ostree/2017.2/3.fc25/x86_64/ostree-{,libs-,grub2-}2017.2-3.fc25.x86_64.rpm; do
curl -sSL -O $url
done
rpm -Uvh --force *.rpm
for x in *.rpm; do
rpm2cpio $x | (cd vmcheck && cpio -div)
done
rm vmcheck/etc -rf
rm -f *.rpm
# ✀✀✀ END hack for https://github.com/projectatomic/rpm-ostree/pull/642 ✀✀✀
ostree refs --delete vmcheck || true
ostree commit -b vmcheck -s '' --tree=dir=vmcheck --link-checkout-speedup
ostree admin deploy vmcheck