aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanilo Šegan <danilo.segan@linaro.org>2013-02-26 09:38:32 +0100
committerDanilo Šegan <danilo.segan@linaro.org>2013-02-26 09:38:32 +0100
commitd687a5e1326288228e5ec8fd3c795171a5fe69f4 (patch)
tree7f281633231201163abf5d4f7a32ce9336e8a392
parentff1b5b1279f60a804d862d7752e7ce9ff75c3e90 (diff)
Revert r155-r157 introducing checks for BUILD-INFO.txt.
-rw-r--r--license_protected_downloads/buildinfo.py2
-rw-r--r--license_protected_downloads/tests/test_buildinfo.py6
-rw-r--r--license_protected_downloads/tests/test_views.py8
-rw-r--r--license_protected_downloads/tests/testserver_root/build-info/empty-build-info/BUILD-INFO.txt0
-rw-r--r--license_protected_downloads/tests/testserver_root/build-info/empty-build-info/test.txt1
-rw-r--r--sampleroot/build-info/empty-build-info/BUILD-INFO.txt0
-rw-r--r--sampleroot/build-info/empty-build-info/test.txt1
-rwxr-xr-xscripts/publish_to_snapshots.py16
-rw-r--r--tests/test_publish_to_snapshots.py31
9 files changed, 0 insertions, 65 deletions
diff --git a/license_protected_downloads/buildinfo.py b/license_protected_downloads/buildinfo.py
index adec394..be6a83c 100644
--- a/license_protected_downloads/buildinfo.py
+++ b/license_protected_downloads/buildinfo.py
@@ -106,8 +106,6 @@ class BuildInfo:
return False
def parseData(self, lines):
- if not lines:
- raise IncorrectDataFormatException("Array is empty.")
if not isinstance(lines, list):
raise IncorrectDataFormatException("No array provided.")
format_line = lines.pop(0)
diff --git a/license_protected_downloads/tests/test_buildinfo.py b/license_protected_downloads/tests/test_buildinfo.py
index e577869..bd5c1ef 100644
--- a/license_protected_downloads/tests/test_buildinfo.py
+++ b/license_protected_downloads/tests/test_buildinfo.py
@@ -89,12 +89,6 @@ class BuildInfoTests(unittest.TestCase):
with self.assertRaises(IncorrectDataFormatException):
build_info.parseLine(line)
- def test_parseData_empty_fails(self):
- build_info = BuildInfo(self.buildinfo_file_path)
-
- with self.assertRaises(IncorrectDataFormatException):
- build_info.parseData([])
-
def test_parseData_no_format_version_fails(self):
build_info = BuildInfo(self.buildinfo_file_path)
diff --git a/license_protected_downloads/tests/test_views.py b/license_protected_downloads/tests/test_views.py
index 5de2281..ce33b29 100644
--- a/license_protected_downloads/tests/test_views.py
+++ b/license_protected_downloads/tests/test_views.py
@@ -431,14 +431,6 @@ class ViewTests(BaseServeViewTest):
# If a build-info file is invalid, we don't allow access
self.assertEqual(response.status_code, 403)
- def test_empty_build_info_file(self):
- target_file = "build-info/empty-build-info/test.txt"
- url = urlparse.urljoin("http://testserver/", target_file)
- response = self.client.get(url, follow=True)
-
- # If a build-info file is invalid, we don't allow access
- self.assertEqual(response.status_code, 403)
-
def test_unable_to_download_hidden_files(self):
target_file = '~linaro-android/staging-vexpress-a9/OPEN-EULA.txt'
url = urlparse.urljoin("http://testserver/", target_file)
diff --git a/license_protected_downloads/tests/testserver_root/build-info/empty-build-info/BUILD-INFO.txt b/license_protected_downloads/tests/testserver_root/build-info/empty-build-info/BUILD-INFO.txt
deleted file mode 100644
index e69de29..0000000
--- a/license_protected_downloads/tests/testserver_root/build-info/empty-build-info/BUILD-INFO.txt
+++ /dev/null
diff --git a/license_protected_downloads/tests/testserver_root/build-info/empty-build-info/test.txt b/license_protected_downloads/tests/testserver_root/build-info/empty-build-info/test.txt
deleted file mode 100644
index e55da4b..0000000
--- a/license_protected_downloads/tests/testserver_root/build-info/empty-build-info/test.txt
+++ /dev/null
@@ -1 +0,0 @@
-This is protected with click-through Linaro license.
diff --git a/sampleroot/build-info/empty-build-info/BUILD-INFO.txt b/sampleroot/build-info/empty-build-info/BUILD-INFO.txt
deleted file mode 100644
index e69de29..0000000
--- a/sampleroot/build-info/empty-build-info/BUILD-INFO.txt
+++ /dev/null
diff --git a/sampleroot/build-info/empty-build-info/test.txt b/sampleroot/build-info/empty-build-info/test.txt
deleted file mode 100644
index e55da4b..0000000
--- a/sampleroot/build-info/empty-build-info/test.txt
+++ /dev/null
@@ -1 +0,0 @@
-This is protected with click-through Linaro license.
diff --git a/scripts/publish_to_snapshots.py b/scripts/publish_to_snapshots.py
index 6d43cef..5276751 100755
--- a/scripts/publish_to_snapshots.py
+++ b/scripts/publish_to_snapshots.py
@@ -15,7 +15,6 @@ staging_target_path = '/srv/staging.snapshots.linaro.org/www/'
product_dir_path = 'target/product'
PASS = 0
FAIL = 1
-buildinfo = 'BUILD-INFO.txt'
acceptable_job_types = [
'android',
'prebuilt',
@@ -368,13 +367,6 @@ class SnapshotsPublisher(object):
print "Failed to move files destination path", target_dir_path
return FAIL
- def check_buildinfo(self, build_dir_path):
- buildinfo_path = os.path.join(build_dir_path, buildinfo)
- if not os.path.exists(buildinfo_path):
- return FAIL
-
- return PASS
-
def main():
global uploads_path
@@ -395,14 +387,6 @@ def main():
if build_dir_path is None or target_dir_path is None:
print "Problem with build/target path, move failed"
return FAIL
- ret = publisher.check_buildinfo(build_dir_path)
- if ret != PASS:
- print "ERROR: BUILD-INFO.txt is not present in build."
- print "WARNING: Nothing was published."
- # Remove artifacts from upload dir
- if os.path.isdir(build_dir_path):
- shutil.rmtree(build_dir_path)
- return FAIL
ret = publisher.move_artifacts(args, build_dir_path, target_dir_path)
if ret != PASS:
print "Move Failed"
diff --git a/tests/test_publish_to_snapshots.py b/tests/test_publish_to_snapshots.py
index 69b9f97..1cecff0 100644
--- a/tests/test_publish_to_snapshots.py
+++ b/tests/test_publish_to_snapshots.py
@@ -11,9 +11,6 @@ from scripts.publish_to_snapshots import (
SnapshotsPublisher,
setup_parser,
product_dir_path,
- FAIL,
- PASS,
- buildinfo
)
@@ -729,31 +726,3 @@ class TestSnapshotsPublisher(TestCase):
self.assertEqual(content, open(resulting_file).read())
self.assertEqual(howto_content, open(resulting_howto_file).read())
shutil.rmtree(source_dir)
-
- def test_check_buildinfo(self):
- self.publisher = SnapshotsPublisher()
- param = self.parser.parse_args(
- ['-t', 'prebuilt', '-j', 'precise-armhf-ubuntu-desktop',
- '-n', '1'])
- self.publisher.validate_args(param)
- build_dir = '/'.join([param.job_name, str(param.build_num)])
- build_path = os.path.join(self.uploads_path, build_dir)
- os.makedirs(build_path)
-
- file_name = os.path.join(build_path, buildinfo)
- file = open(file_name, "w")
- file.close()
-
- self.assertEqual(PASS, self.publisher.check_buildinfo(build_path))
-
- def test_check_buildinfo_no_file(self):
- self.publisher = SnapshotsPublisher()
- param = self.parser.parse_args(
- ['-t', 'prebuilt', '-j', 'precise-armhf-ubuntu-desktop',
- '-n', '1'])
- self.publisher.validate_args(param)
- build_dir = '/'.join([param.job_name, str(param.build_num)])
- build_path = os.path.join(self.uploads_path, build_dir)
- os.makedirs(build_path)
-
- self.assertEqual(FAIL, self.publisher.check_buildinfo(build_path))