summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases/runcmd.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-05-08 16:56:32 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-05-09 11:58:04 +0100
commit8e2d0575e4e7036b5f60e632f377a8ab2b96ead8 (patch)
tree96ff3e9c0e0767b03ede3273a21f9acad1a07b46 /meta/lib/oeqa/selftest/cases/runcmd.py
parent728c6c43deff8a3259a1e0f3aef799bec9983090 (diff)
downloadopenembedded-core-contrib-8e2d0575e4e7036b5f60e632f377a8ab2b96ead8.tar.gz
oeqa: Drop OETestID
These IDs refer to testopia which we're no longer using. We would now use the test names to definitively reference tests and the IDs can be dropped, along with their supporting code. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/runcmd.py')
-rw-r--r--meta/lib/oeqa/selftest/cases/runcmd.py17
1 files changed, 0 insertions, 17 deletions
diff --git a/meta/lib/oeqa/selftest/cases/runcmd.py b/meta/lib/oeqa/selftest/cases/runcmd.py
index a1615cfd20..ed4ba8a465 100644
--- a/meta/lib/oeqa/selftest/cases/runcmd.py
+++ b/meta/lib/oeqa/selftest/cases/runcmd.py
@@ -1,7 +1,6 @@
from oeqa.selftest.case import OESelftestTestCase
from oeqa.utils.commands import runCmd
from oeqa.utils import CommandError
-from oeqa.core.decorator.oeid import OETestID
import subprocess
import threading
@@ -27,60 +26,49 @@ class RunCmdTests(OESelftestTestCase):
TIMEOUT = 5
DELTA = 3
- @OETestID(1916)
def test_result_okay(self):
result = runCmd("true")
self.assertEqual(result.status, 0)
- @OETestID(1915)
def test_result_false(self):
result = runCmd("false", ignore_status=True)
self.assertEqual(result.status, 1)
- @OETestID(1917)
def test_shell(self):
# A shell is used for all string commands.
result = runCmd("false; true", ignore_status=True)
self.assertEqual(result.status, 0)
- @OETestID(1910)
def test_no_shell(self):
self.assertRaises(FileNotFoundError,
runCmd, "false; true", shell=False)
- @OETestID(1906)
def test_list_not_found(self):
self.assertRaises(FileNotFoundError,
runCmd, ["false; true"])
- @OETestID(1907)
def test_list_okay(self):
result = runCmd(["true"])
self.assertEqual(result.status, 0)
- @OETestID(1913)
def test_result_assertion(self):
self.assertRaisesRegexp(AssertionError, "Command 'echo .* false' returned non-zero exit status 1:\nfoobar",
runCmd, "echo foobar >&2; false", shell=True)
- @OETestID(1914)
def test_result_exception(self):
self.assertRaisesRegexp(CommandError, "Command 'echo .* false' returned non-zero exit status 1 with output: foobar",
runCmd, "echo foobar >&2; false", shell=True, assert_error=False)
- @OETestID(1911)
def test_output(self):
result = runCmd("echo stdout; echo stderr >&2", shell=True)
self.assertEqual("stdout\nstderr", result.output)
self.assertEqual("", result.error)
- @OETestID(1912)
def test_output_split(self):
result = runCmd("echo stdout; echo stderr >&2", shell=True, stderr=subprocess.PIPE)
self.assertEqual("stdout", result.output)
self.assertEqual("stderr", result.error)
- @OETestID(1920)
def test_timeout(self):
numthreads = threading.active_count()
start = time.time()
@@ -91,7 +79,6 @@ class RunCmdTests(OESelftestTestCase):
self.assertLess(end - start, self.TIMEOUT + self.DELTA)
self.assertEqual(numthreads, threading.active_count())
- @OETestID(1921)
def test_timeout_split(self):
numthreads = threading.active_count()
start = time.time()
@@ -102,14 +89,12 @@ class RunCmdTests(OESelftestTestCase):
self.assertLess(end - start, self.TIMEOUT + self.DELTA)
self.assertEqual(numthreads, threading.active_count())
- @OETestID(1918)
def test_stdin(self):
numthreads = threading.active_count()
result = runCmd("cat", data=b"hello world", timeout=self.TIMEOUT)
self.assertEqual("hello world", result.output)
self.assertEqual(numthreads, threading.active_count())
- @OETestID(1919)
def test_stdin_timeout(self):
numthreads = threading.active_count()
start = time.time()
@@ -119,14 +104,12 @@ class RunCmdTests(OESelftestTestCase):
self.assertLess(end - start, self.TIMEOUT + self.DELTA)
self.assertEqual(numthreads, threading.active_count())
- @OETestID(1908)
def test_log(self):
log = MemLogger()
result = runCmd("echo stdout; echo stderr >&2", shell=True, output_log=log)
self.assertEqual(["Running: echo stdout; echo stderr >&2", "stdout", "stderr"], log.info_msgs)
self.assertEqual([], log.error_msgs)
- @OETestID(1909)
def test_log_split(self):
log = MemLogger()
result = runCmd("echo stdout; echo stderr >&2", shell=True, output_log=log, stderr=subprocess.PIPE)