提交 0cc70f1c 编写于 作者: C Cleber Rosa 提交者: Lukáš Doktor

Replay with remote functional test: skip if remote plugin is not available

When a plugin is not installed, its command line options are not
registered with the optparse based code.  That is caught earlier than
Avocado's own handling of incompatible options (in this case, the replay
and the remote runner), and results in the errors such as:

  avocado run: error: unrecognized arguments: --remote-hostname

When building RPM packages for Python 3, the remote runner plugin is
not available, and this test should be skipped.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 949f846f
import glob
import os
import tempfile
import shutil
import tempfile
import unittest
import pkg_resources
from avocado.core import exit_codes
from avocado.utils import process
......@@ -14,6 +16,14 @@ basedir = os.path.abspath(basedir)
AVOCADO = os.environ.get("UNITTEST_AVOCADO_CMD", "./scripts/avocado")
def remote_capable():
try:
pkg_resources.require('avocado-framework-plugin-runner-remote')
return True
except pkg_resources.DistributionNotFound:
return False
class ReplayTests(unittest.TestCase):
def setUp(self):
......@@ -148,6 +158,8 @@ class ReplayTests(unittest.TestCase):
b'INTERRUPT 0')
self.assertIn(msg, result.stdout)
@unittest.skipUnless(remote_capable(),
"Remote runner plugin is not available")
def test_run_replay_remotefail(self):
"""
Runs a replay job using remote plugin (not supported).
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册