import pytest


class TestLocking(object):

    def test_correct_os_type(self, ctx, config):
        os_type = ctx.config.get("os_type")
        if os_type is None:
            pytest.skip('os_type was not defined')
        for remote in ctx.cluster.remotes.iterkeys():
            assert remote.os.name == os_type

    def test_correct_os_version(self, ctx, config):
        os_version = ctx.config.get("os_version")
        if os_version is None:
            pytest.skip('os_version was not defined')
        for remote in ctx.cluster.remotes.iterkeys():
            assert remote.os.version == os_version

    def test_correct_machine_type(self, ctx, config):
        machine_type = ctx.machine_type
        for remote in ctx.cluster.remotes.iterkeys():
            assert remote.machine_type in machine_type

import pytest


class TestLocking(object):

    def test_correct_os_type(self, ctx, config):
        os_type = ctx.config.get("os_type")
        if os_type is None:
            pytest.skip('os_type was not defined')
        for remote in ctx.cluster.remotes.iterkeys():
            assert remote.os.name == os_type

    def test_correct_os_version(self, ctx, config):
        os_version = ctx.config.get("os_version")
        if os_version is None:
            pytest.skip('os_version was not defined')
        if ctx.config.get("os_type") == "debian":
            pytest.skip('known issue with debian versions; see: issue #10878')
        for remote in ctx.cluster.remotes.iterkeys():
            assert remote.os.version == os_version

    def test_correct_machine_type(self, ctx, config):
        machine_type = ctx.machine_type
        for remote in ctx.cluster.remotes.iterkeys():
            assert remote.machine_type in machine_type

Make an exception for debian in tests.test_correct_os_version
Make an exception for debian in tests.test_correct_os_version

This is because of a known issue where downburst gives us 7.1 when we
ask for 7.0.  We're ok with this behavior for now. See: issue #10878

Signed-off-by: Andrew Schoen <1bb641dc23c3a93cce4eee683bcf4b2bea7903a3@redhat.com>

  import pytest
  
  
  class TestLocking(object):
  
      def test_correct_os_type(self, ctx, config):
          os_type = ctx.config.get("os_type")
          if os_type is None:
              pytest.skip('os_type was not defined')
          for remote in ctx.cluster.remotes.iterkeys():
              assert remote.os.name == os_type
  
      def test_correct_os_version(self, ctx, config):
          os_version = ctx.config.get("os_version")
          if os_version is None:
              pytest.skip('os_version was not defined')
+         if ctx.config.get("os_type") == "debian":
+             pytest.skip('known issue with debian versions; see: issue #10878')
          for remote in ctx.cluster.remotes.iterkeys():
              assert remote.os.version == os_version
  
      def test_correct_machine_type(self, ctx, config):
          machine_type = ctx.machine_type
          for remote in ctx.cluster.remotes.iterkeys():
              assert remote.machine_type in machine_type
  
Make an exception for debian in tests.test_correct_os_version
## Code Before:
import pytest


class TestLocking(object):

    def test_correct_os_type(self, ctx, config):
        os_type = ctx.config.get("os_type")
        if os_type is None:
            pytest.skip('os_type was not defined')
        for remote in ctx.cluster.remotes.iterkeys():
            assert remote.os.name == os_type

    def test_correct_os_version(self, ctx, config):
        os_version = ctx.config.get("os_version")
        if os_version is None:
            pytest.skip('os_version was not defined')
        for remote in ctx.cluster.remotes.iterkeys():
            assert remote.os.version == os_version

    def test_correct_machine_type(self, ctx, config):
        machine_type = ctx.machine_type
        for remote in ctx.cluster.remotes.iterkeys():
            assert remote.machine_type in machine_type

## Instruction:
Make an exception for debian in tests.test_correct_os_version
## Code After:
import pytest


class TestLocking(object):

    def test_correct_os_type(self, ctx, config):
        os_type = ctx.config.get("os_type")
        if os_type is None:
            pytest.skip('os_type was not defined')
        for remote in ctx.cluster.remotes.iterkeys():
            assert remote.os.name == os_type

    def test_correct_os_version(self, ctx, config):
        os_version = ctx.config.get("os_version")
        if os_version is None:
            pytest.skip('os_version was not defined')
        if ctx.config.get("os_type") == "debian":
            pytest.skip('known issue with debian versions; see: issue #10878')
        for remote in ctx.cluster.remotes.iterkeys():
            assert remote.os.version == os_version

    def test_correct_machine_type(self, ctx, config):
        machine_type = ctx.machine_type
        for remote in ctx.cluster.remotes.iterkeys():
            assert remote.machine_type in machine_type
