diff --git a/tests/test_mirror.py b/tests/test_mirror.py index 687315d55d4e..af14ca9d9175 100644 --- a/tests/test_mirror.py +++ b/tests/test_mirror.py @@ -1,5 +1,5 @@ # This test suite covers the functionality of mirror feature in SwSS -import platform +import distro import pytest import time @@ -235,7 +235,7 @@ def remove_fdb(self, vlan, mac): # Ignore testcase in Debian Jessie # TODO: Remove this skip if Jessie support is no longer needed - @pytest.mark.skipif(StrictVersion(platform.linux_distribution()[1]) <= StrictVersion('8.9'), reason="Debian 8.9 or before has no support") + @pytest.mark.skipif(StrictVersion(distro.linux_distribution()[1]) <= StrictVersion('8.9'), reason="Debian 8.9 or before has no support") def test_MirrorToVlanAddRemove(self, dvs, testlog): """ This test covers basic mirror session creation and removal operation @@ -442,7 +442,7 @@ def test_MirrorToLagAddRemove(self, dvs, testlog): # Ignore testcase in Debian Jessie # TODO: Remove this skip if Jessie support is no longer needed - @pytest.mark.skipif(StrictVersion(platform.linux_distribution()[1]) <= StrictVersion('8.9'), reason="Debian 8.9 or before has no support") + @pytest.mark.skipif(StrictVersion(distro.linux_distribution()[1]) <= StrictVersion('8.9'), reason="Debian 8.9 or before has no support") def test_MirrorDestMoveVlan(self, dvs, testlog): """ This test tests mirror session destination move from non-VLAN to VLAN diff --git a/tests/test_vlan.py b/tests/test_vlan.py index 39b9bf76555a..79b76f73ceb9 100644 --- a/tests/test_vlan.py +++ b/tests/test_vlan.py @@ -1,4 +1,4 @@ -import platform +import distro import pytest from distutils.version import StrictVersion @@ -158,7 +158,7 @@ def test_VlanIncrementalConfig(self, dvs): self.dvs_vlan.remove_vlan(vlan) self.dvs_vlan.get_and_verify_vlan_ids(0) - @pytest.mark.skipif(StrictVersion(platform.linux_distribution()[1]) <= StrictVersion('8.9'), + @pytest.mark.skipif(StrictVersion(distro.linux_distribution()[1]) <= StrictVersion('8.9'), reason="Debian 8.9 or before has no support") @pytest.mark.parametrize("test_input, expected", [ (["Vla", "2"], 0), @@ -185,7 +185,7 @@ def test_AddVlanWithIncorrectKeyPrefix(self, dvs, test_input, expected): self.dvs_vlan.remove_vlan(vlan_id) self.dvs_vlan.get_and_verify_vlan_ids(0) - @pytest.mark.skipif(StrictVersion(platform.linux_distribution()[1]) <= StrictVersion('8.9'), + @pytest.mark.skipif(StrictVersion(distro.linux_distribution()[1]) <= StrictVersion('8.9'), reason="Debian 8.9 or before has no support") @pytest.mark.parametrize("test_input, expected", [ (["Vlan", "abc"], 0), @@ -277,7 +277,7 @@ def test_RemoveNonexistentVlan(self, dvs): self.dvs_vlan.remove_vlan(vlan) self.dvs_vlan.get_and_verify_vlan_ids(0) - @pytest.mark.skipif(StrictVersion(platform.linux_distribution()[1]) <= StrictVersion('8.9'), + @pytest.mark.skipif(StrictVersion(distro.linux_distribution()[1]) <= StrictVersion('8.9'), reason="Debian 8.9 or before has no support") @pytest.mark.parametrize("test_input, expected", [ (["tagging_mode", "untagged"], [1, "SAI_VLAN_TAGGING_MODE_UNTAGGED"]), @@ -385,7 +385,7 @@ def test_VlanDbData(self, dvs): self.dvs_vlan.remove_vlan(vlan) - @pytest.mark.skipif(StrictVersion(platform.linux_distribution()[1]) <= StrictVersion('8.9'), + @pytest.mark.skipif(StrictVersion(distro.linux_distribution()[1]) <= StrictVersion('8.9'), reason="Debian 8.9 or before has no support") @pytest.mark.parametrize("test_input, expected", [ (["untagged"], ["SAI_VLAN_TAGGING_MODE_UNTAGGED"]),