Add Neon pkg unittests, remove wrong docs 02/76702/2
authorDaniel Farrell <dfarrell@redhat.com>
Fri, 5 Oct 2018 16:25:57 +0000 (12:25 -0400)
committerDaniel Farrell <dfarrell@redhat.com>
Mon, 8 Oct 2018 22:52:23 +0000 (22:52 +0000)
Add remaining packaging unittest coveage for Neon builds.

Remove docs about code that is supposed to need updating, but actually
doesn't. The URLs in those tests may expire, but they apparently no
longer need to actually work to be used in tests (I think for old
versions of the package building logic they had to be curl-able).

Change-Id: I770dd4eabe99f80878ab97741346a25d2f4f40c8
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
packages/test_lib.py

index 3365456393c2064a899492fca386eec614d9eb43..6a6f95a3b219fe7dca0fd70de38bc9c75c9cea53 100644 (file)
@@ -61,8 +61,7 @@ class TestExtractVersion(unittest.TestCase):
 
     def test_oxygen_snapshot_url(self):
         """Test URL of an ODL Oxygen snapshot build."""
-        # NB: This will need to be updated as old builds expire
-        url = "%s/opendaylight.snapshot/org/opendaylight/integration/karaf/0.8.0-SNAPSHOT/karaf-0.8.0-20180202.194543-1393.tar.gz" % self.nexus_url
+        url = "%s/opendaylight.snapshot/org/opendaylight/integration/karaf/0.8.0-SNAPSHOT/araf-0.8.0-20180202.194543-1393.tar.gz" % self.nexus_url
         version = lib.extract_version(url)
         self.assertEqual(version["version_major"], "8")
         self.assertEqual(version["version_minor"], "0")
@@ -72,7 +71,6 @@ class TestExtractVersion(unittest.TestCase):
 
     def test_oxygen_snapshot_zip_url(self):
         """Test URL of an ODL Oxygen snapshot build zip archive."""
-        # NB: This will need to be updated as old builds expire
         url = "%s/opendaylight.snapshot/org/opendaylight/integration/karaf/0.8.0-SNAPSHOT/karaf-0.8.0-20180202.194543-1393.zip" % self.nexus_url
         version = lib.extract_version(url)
         self.assertEqual(version["version_major"], "8")
@@ -83,7 +81,6 @@ class TestExtractVersion(unittest.TestCase):
 
     def test_fluorine_snapshot_url(self):
         """Test URL of an ODL Fluorine snapshot build."""
-        # NB: This will need to be updated as old builds expire
         url = "%s/opendaylight.snapshot/org/opendaylight/integration/karaf/0.9.0-SNAPSHOT/karaf-0.9.0-20180411.203859-563.tar.gz" % self.nexus_url
         version = lib.extract_version(url)
         self.assertEqual(version["version_major"], "9")
@@ -94,7 +91,6 @@ class TestExtractVersion(unittest.TestCase):
 
     def test_fluorine_snapshot_zip_url(self):
         """Test URL of an ODL Fluorine snapshot build zip archive."""
-        # NB: This will need to be updated as old builds expire
         url = "%s/opendaylight.snapshot/org/opendaylight/integration/karaf/0.9.0-SNAPSHOT/karaf-0.9.0-20180411.203859-563.tar.gz" % self.nexus_url
         version = lib.extract_version(url)
         self.assertEqual(version["version_major"], "9")
@@ -105,7 +101,6 @@ class TestExtractVersion(unittest.TestCase):
 
     def test_neon_snapshot_url(self):
         """Test URL of an ODL Neon snapshot build."""
-        # NB: This will need to be updated as old builds expire
         url = "%s/opendaylight.snapshot/org/opendaylight/integration/karaf/0.10.0-SNAPSHOT/karaf-0.10.0-20181004.142605-697.tar.gz" % self.nexus_url
         version = lib.extract_version(url)
         self.assertEqual(version["version_major"], "10")
@@ -116,7 +111,6 @@ class TestExtractVersion(unittest.TestCase):
 
     def test_neon_snapshot_zip_url(self):
         """Test URL of an ODL Neon snapshot build zip archive."""
-        # NB: This will need to be updated as old builds expire
         url = "%s/opendaylight.snapshot/org/opendaylight/integration/karaf/0.10.0-SNAPSHOT/karaf-0.10.0-20181004.142605-697.zip" % self.nexus_url
         version = lib.extract_version(url)
         self.assertEqual(version["version_major"], "10")
@@ -127,7 +121,6 @@ class TestExtractVersion(unittest.TestCase):
 
     def test_oxygen_multipatch_zip_url(self):
         """Test URL of an ODL Oxygen multipatch-test build zip archive."""
-        # NB: This will need to be updated as old builds expire
         url = "%s/opendaylight.snapshot/org/opendaylight/integration/integration/distribution/karaf/0.8.0-SNAPSHOT/karaf-0.8.0-20180204.191936-134.zip" % self.nexus_url
         version = lib.extract_version(url)
         self.assertEqual(version["version_major"], "8")
@@ -138,7 +131,6 @@ class TestExtractVersion(unittest.TestCase):
 
     def test_fluorine_multipatch_zip_url(self):
         """Test URL of an ODL Fluorine multipatch-test build zip archive."""
-        # NB: This will need to be updated as old builds expire
         url = "%s/opendaylight.snapshot/org/opendaylight/integration/integration/distribution/karaf/0.9.0-SNAPSHOT/karaf-0.9.0-20180531.192226-59.zip" % self.nexus_url
         version = lib.extract_version(url)
         self.assertEqual(version["version_major"], "9")
@@ -149,7 +141,6 @@ class TestExtractVersion(unittest.TestCase):
 
     def test_neon_multipatch_zip_url(self):
         """Test URL of an ODL Neon multipatch-test build zip archive."""
-        # NB: This will need to be updated as old builds expire
         url = "%s/opendaylight.snapshot/org/opendaylight/integration/integration/distribution/karaf/0.10.0-SNAPSHOT/karaf-0.10.0-20180925.093600-5.zip" % self.nexus_url
         version = lib.extract_version(url)
         self.assertEqual(version["version_major"], "10")
@@ -180,6 +171,10 @@ class TestGetSnapURL(unittest.TestCase):
         """Test Fluorine major version gives sane snapshot URL."""
         self.validate_snap_url(lib.get_snap_url("9"))
 
+    def test_neon(self):
+        """Test Neon major version gives sane snapshot URL."""
+        self.validate_snap_url(lib.get_snap_url("10"))
+
 
 class TestGetDistroNamePrefix(unittest.TestCase):
 
@@ -212,6 +207,16 @@ class TestGetDistroNamePrefix(unittest.TestCase):
         distro_prefix = lib.get_distro_name_prefix(9)
         self.assertEqual(distro_prefix, self.k4_distro_prefix)
 
+    def test_neon(self):
+        """Test Neon major version gives Karaf 4 prefix."""
+        distro_prefix = lib.get_distro_name_prefix("10")
+        self.assertEqual(distro_prefix, self.k4_distro_prefix)
+
+    def test_neon_int(self):
+        """Test Neon major version as int gives Karaf 4 prefix."""
+        distro_prefix = lib.get_distro_name_prefix(10)
+        self.assertEqual(distro_prefix, self.k4_distro_prefix)
+
     def test_managed_release_fluorine(self):
         """Test Managed Release URL gives MR distro prefix."""
         distro_prefix = lib.get_distro_name_prefix(9, self.mrel_distro_url)
@@ -292,6 +297,16 @@ class TestGetJavaVersion(unittest.TestCase):
         java_version = lib.get_java_version("9")
         self.assertEqual(java_version, 8)
 
+    def test_neon_given_int(self):
+        """Pass Neon major version, check that Java 8 returned."""
+        java_version = lib.get_java_version(10)
+        self.assertEqual(java_version, 8)
+
+    def test_neon_given_str(self):
+        """Pass Neon major version, check that Java 8 returned."""
+        java_version = lib.get_java_version("10")
+        self.assertEqual(java_version, 8)
+
 
 class TestGetChangelogDate(unittest.TestCase):