#249: add 'test-desert-island', to assert that a tahoe-deps.tar.gz -enabled build does not download anything

This commit is contained in:
Brian Warner 2008-09-16 18:37:02 -07:00
parent fd432b43bf
commit 1853020a5f
2 changed files with 34 additions and 0 deletions

View File

@ -245,6 +245,18 @@ clean:
find-trailing-spaces: find-trailing-spaces:
$(PYTHON) misc/find-trailing-spaces.py -r src $(PYTHON) misc/find-trailing-spaces.py -r src
# The test-desert-island target grabs the tahoe-deps tarball, unpacks it,
# does a build, then asserts that the build did not try to download anything
# as it ran. Invoke this on a new tree, or after a 'clean', to make sure the
# support/lib/ directory is gone.
test-desert-island:
wget http://allmydata.org/source/tahoe/tarballs/tahoe-deps.tar.gz
tar xf tahoe-deps.tar.gz
$(MAKE) 2>&1 | tee make.out
$(PYTHON) misc/check-build.py make.out no-downloads
# TARBALL GENERATION # TARBALL GENERATION
.PHONY: tarballs upload-tarballs .PHONY: tarballs upload-tarballs
tarballs: tarballs:

22
misc/check-build.py Normal file
View File

@ -0,0 +1,22 @@
#! /usr/bin/env python
# This helper script is used with the 'test-desert-island' Makefile target.
import sys
good = True
build_out = sys.argv[1]
mode = sys.argv[2]
for line in open(build_out, "r"):
if mode == "no-downloads" and "downloading" in line.lower():
print line,
good = False
if good:
if mode == "no-downloads":
print "Good: build did not try to download any files"
sys.exit(0)
else:
if mode == "no-downloads":
print "Failed: build tried to download files"
sys.exit(1)