#255 Allow tests to indicate they don't support the current platform
Merged 4 years ago by puiterwijk. Opened 4 years ago by puiterwijk.
puiterwijk/ipsilon tests-skip  into  master

file modified
+9
@@ -81,6 +81,15 @@ 

          self.testuser = pwd.getpwuid(os.getuid())[0]

          self.processes = []

  

+     def platform_supported(self):

+         """This return whether the current platform supports this test.

+ 

+         This is used for example with specific modules or features that are not

+         supported on all platforms due to dependency availability.

+         """

+         # Every test defaults to being available on every platform

+         return True

+ 

      def force_remove(self, op, name, info):

          os.chmod(name, 0700)

          os.remove(name)

file modified
+4
@@ -87,6 +87,10 @@ 

          sys.exit(1)

      test = tests.plugins[args['test']]

  

+     if not test.platform_supported():

+         print >> sys.stderr, "Test %s not supported on platform" % args['test']

+         sys.exit(0)

+ 

      if not os.path.exists(args['path']):

          os.makedirs(args['path'])

  

Commit 6108e14 fixes this pull-request

Pull-Request has been merged by puiterwijk@redhat.com

4 years ago