aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStevan Radakovic <stevan.radakovic@linaro.org>2012-05-16 18:00:20 +0200
committerStevan Radakovic <stevan.radakovic@linaro.org>2012-05-16 18:00:20 +0200
commit2975e081a0a58479914514744db841a195826596 (patch)
tree446d6854292867d824ef9688c77ea531981eefa5
parent6388fd168972727ff0b3ba0f5e80b79e43768229 (diff)
Added tests for releases production server.
-rw-r--r--docs/releases.txt117
-rw-r--r--docs/snapshots.txt10
-rw-r--r--testing/doctest_production_browser.py3
3 files changed, 123 insertions, 7 deletions
diff --git a/docs/releases.txt b/docs/releases.txt
new file mode 100644
index 0000000..39a39dc
--- /dev/null
+++ b/docs/releases.txt
@@ -0,0 +1,117 @@
+Test releases.linaro.org production server
+===========================================
+
+Navigate to the regular ST-E license-protected file and initiate download
+-------------------------------------------------------------------------
+
+Include class we will use for this test and init fetcher.
+
+ >>> from testing.doctest_production_browser import DoctestProductionBrowser
+ >>> browser = DoctestProductionBrowser("http://releases.linaro.org/")
+
+Visiting homepage and check for title.
+
+ >>> print browser.get_content_title()
+ Index of /
+
+Browsing into the latest/android/leb-snowball should work without any
+license popping out.
+
+ >>> browser.browse_to_relative("latest/")
+ >>> print browser.get_content_title()
+ Index of /latest
+ >>> browser.browse_to_relative("android/")
+ >>> print browser.get_content_title()
+ Index of /latest/android
+ >>> browser.browse_to_relative("leb-snowball/")
+ >>> print browser.get_content_title()
+ Index of /latest/android/leb-snowball
+
+Mock the boot.tar.bz2 file download and check the license.
+Check if the ST-E license is encountered.
+
+ >>> browser.browse_to_relative("boot.tar.bz2")
+ >>> print browser.get_license_text()
+ This Agreement is a legal...ST-Ericsson...GOVERNING LAW AND JURISDICTION...
+ ...
+
+Now, emulate clicking on the Accept Licence link which redirects us to the
+download file. Check if the headers of the requested file are in order.
+
+ >>> print browser.accept_license_get_header()
+ Accept-Ranges:...
+ Content-Type: application/x-bzip2...
+ Location: http://releases...snowball...boot.tar.bz2...
+ ...
+
+Now, emulate clicking on the Decline Licence link which redirects us to the
+decline page.
+
+ >>> print browser.decline_license()
+ License has not been accepted
+
+
+Navigate to the regular Samsung license-protected file and initiate download
+----------------------------------------------------------------------------
+
+Browsing back into the /latest/android/leb-origen. It should work
+without any license popping out.
+
+ >>> browser.browse_to_absolute("latest/")
+ >>> print browser.get_content_title()
+ Index of /latest
+ >>> browser.browse_to_relative("android/")
+ >>> print browser.get_content_title()
+ Index of /latest/android
+ >>> browser.browse_to_relative("leb-origen/")
+ >>> print browser.get_content_title()
+ Index of /latest/android/leb-origen
+
+Mock the boot.tar.bz2 file download and check the license.
+Check if the Samsung license is encountered.
+
+ >>> browser.browse_to_relative("boot.tar.bz2")
+ >>> print browser.get_license_text()
+ IMPORTANT...SAMSUNG ELECTRONICS...Entire Agreement...
+ ...
+
+Now, emulate clicking on the Accept Licence link which redirects us to the
+download file. Check if the headers of the requested file are in order.
+
+ >>> print browser.accept_license_get_header()
+ Accept-Ranges:...
+ Content-Type: application/x-bzip2...
+ Location: http://releases...origen...boot.tar.bz2...
+ ...
+
+Now, emulate clicking on the Decline Licence link which redirects us to the
+decline page.
+
+ >>> print browser.decline_license()
+ License has not been accepted
+
+
+Navigate to the non-license-protected file and initiate download
+----------------------------------------------------------------
+
+Browsing back into the latest/android/leb-panda. It should work
+without any license popping out.
+
+ >>> browser.browse_to_absolute("latest/")
+ >>> print browser.get_content_title()
+ Index of /latest
+ >>> browser.browse_to_relative("android/")
+ >>> print browser.get_content_title()
+ Index of /latest/android
+ >>> browser.browse_to_relative("leb-panda/")
+ >>> print browser.get_content_title()
+ Index of /latest/android/leb-panda
+
+Mock the boot.tar.bz2 file download. There should not be any
+license encountered.
+
+ >>> browser.browse_to_relative("boot.tar.bz2")
+ >>> print browser.get_unprotected_file_header()
+ Accept-Ranges:...
+ Content-Type: application/x-bzip2...
+ ...
diff --git a/docs/snapshots.txt b/docs/snapshots.txt
index a8a4e64..f772112 100644
--- a/docs/snapshots.txt
+++ b/docs/snapshots.txt
@@ -2,14 +2,14 @@ Test snapshots.linaro.org production server
===========================================
Navigate to the regular ST-E license-protected file and initiate download
---------------------------------------------------------------------
+-------------------------------------------------------------------------
Include class we will use for this test and init fetcher.
>>> from testing.doctest_production_browser import DoctestProductionBrowser
>>> browser = DoctestProductionBrowser("http://snapshots.linaro.org/")
-Visiting homepage and checking for title, android link and footer.
+Visiting homepage and check for title.
>>> print browser.get_content_title()
Index of /
@@ -101,10 +101,10 @@ then origen links, respectively.
>>> print browser.get_content_title()
Index of /android/~linaro-android/...origen...product...origen...
-Finally, mock the userdata.tar.bz2 file download and check the license.
+Finally, mock the boot.tar.bz2 file download and check the license.
Check if the Samsung license is encountered.
- >>> browser.browse_to_relative("userdata.tar.bz2")
+ >>> browser.browse_to_relative("boot.tar.bz2")
>>> print browser.get_license_text()
IMPORTANT...SAMSUNG ELECTRONICS...Entire Agreement...
...
@@ -115,7 +115,7 @@ download file. Check if the headers of the requested file are in order.
>>> print browser.accept_license_get_header()
Accept-Ranges:...
Content-Type: application/x-bzip2...
- Location: http://snapshots...origen...userdata.tar.bz2...
+ Location: http://snapshots...origen...boot.tar.bz2...
...
Now, emulate clicking on the Decline Licence link which redirects us to the
diff --git a/testing/doctest_production_browser.py b/testing/doctest_production_browser.py
index 6313df3..cf7af5c 100644
--- a/testing/doctest_production_browser.py
+++ b/testing/doctest_production_browser.py
@@ -42,8 +42,7 @@ class DoctestProductionBrowser():
if len(page) == 3:
raise UnexpectedLicenseException("License not expected here.")
else:
- #return self.parse_header(self.fetcher.header)
- return self.fetcher.header
+ return self.parse_header(self.fetcher.header)
def get_content(self):
"""Get contents from the current url."""