summaryrefslogtreecommitdiff
path: root/poky/meta/lib/oeqa/selftest/cases
diff options
context:
space:
mode:
Diffstat (limited to 'poky/meta/lib/oeqa/selftest/cases')
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/binutils.py11
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/gcc.py9
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/glibc.py7
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/imagefeatures.py3
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/oescripts.py58
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/runtime_test.py2
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/wic.py6
7 files changed, 80 insertions, 16 deletions
diff --git a/poky/meta/lib/oeqa/selftest/cases/binutils.py b/poky/meta/lib/oeqa/selftest/cases/binutils.py
index 9bc752040..821f52f5a 100644
--- a/poky/meta/lib/oeqa/selftest/cases/binutils.py
+++ b/poky/meta/lib/oeqa/selftest/cases/binutils.py
@@ -4,6 +4,7 @@ import sys
import re
import logging
from oeqa.core.decorator import OETestTag
+from oeqa.core.case import OEPTestResultTestCase
from oeqa.selftest.case import OESelftestTestCase
from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars
@@ -15,7 +16,7 @@ def parse_values(content):
break
@OETestTag("toolchain-user", "toolchain-system")
-class BinutilsCrossSelfTest(OESelftestTestCase):
+class BinutilsCrossSelfTest(OESelftestTestCase, OEPTestResultTestCase):
def test_binutils(self):
self.run_binutils("binutils")
@@ -36,14 +37,14 @@ class BinutilsCrossSelfTest(OESelftestTestCase):
bitbake("{0} -c check".format(recipe))
- ptestsuite = "binutils-{}".format(suite) if suite != "binutils" else suite
- self.extraresults = {"ptestresult.sections" : {ptestsuite : {}}}
-
sumspath = os.path.join(builddir, suite, "{0}.sum".format(suite))
if not os.path.exists(sumspath):
sumspath = os.path.join(builddir, suite, "testsuite", "{0}.sum".format(suite))
+ logpath = os.path.splitext(sumspath)[0] + ".log"
+ ptestsuite = "binutils-{}".format(suite) if suite != "binutils" else suite
+ self.ptest_section(ptestsuite, logfile = logpath)
with open(sumspath, "r") as f:
for test, result in parse_values(f):
- self.extraresults["ptestresult.{}.{}".format(ptestsuite, test)] = {"status" : result}
+ self.ptest_result(ptestsuite, test, result)
diff --git a/poky/meta/lib/oeqa/selftest/cases/gcc.py b/poky/meta/lib/oeqa/selftest/cases/gcc.py
index 2c25b5904..5a917b9c4 100644
--- a/poky/meta/lib/oeqa/selftest/cases/gcc.py
+++ b/poky/meta/lib/oeqa/selftest/cases/gcc.py
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: MIT
import os
from oeqa.core.decorator import OETestTag
+from oeqa.core.case import OEPTestResultTestCase
from oeqa.selftest.case import OESelftestTestCase
from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars, runqemu, Command
@@ -11,7 +12,7 @@ def parse_values(content):
yield i[len(v) + 2:].strip(), v
break
-class GccSelfTestBase(OESelftestTestCase):
+class GccSelfTestBase(OESelftestTestCase, OEPTestResultTestCase):
def check_skip(self, suite):
targets = get_bb_var("RUNTIMETARGET", "gcc-runtime").split()
if suite not in targets:
@@ -41,20 +42,20 @@ class GccSelfTestBase(OESelftestTestCase):
bb_vars = get_bb_vars(["B", "TARGET_SYS"], recipe)
builddir, target_sys = bb_vars["B"], bb_vars["TARGET_SYS"]
- self.extraresults = {"ptestresult.sections" : {}}
for suite in suites:
sumspath = os.path.join(builddir, "gcc", "testsuite", suite, "{0}.sum".format(suite))
if not os.path.exists(sumspath): # check in target dirs
sumspath = os.path.join(builddir, target_sys, suite, "testsuite", "{0}.sum".format(suite))
if not os.path.exists(sumspath): # handle libstdc++-v3 -> libstdc++
sumspath = os.path.join(builddir, target_sys, suite, "testsuite", "{0}.sum".format(suite.split("-")[0]))
+ logpath = os.path.splitext(sumspath)[0] + ".log"
ptestsuite = "gcc-{}".format(suite) if suite != "gcc" else suite
ptestsuite = ptestsuite + "-user" if ssh is None else ptestsuite
- self.extraresults["ptestresult.sections"][ptestsuite] = {}
+ self.ptest_section(ptestsuite, logfile = logpath)
with open(sumspath, "r") as f:
for test, result in parse_values(f):
- self.extraresults["ptestresult.{}.{}".format(ptestsuite, test)] = {"status" : result}
+ self.ptest_result(ptestsuite, test, result)
def run_check_emulated(self, *args, **kwargs):
# build core-image-minimal with required packages
diff --git a/poky/meta/lib/oeqa/selftest/cases/glibc.py b/poky/meta/lib/oeqa/selftest/cases/glibc.py
index 2e42485dd..c687f6ef9 100644
--- a/poky/meta/lib/oeqa/selftest/cases/glibc.py
+++ b/poky/meta/lib/oeqa/selftest/cases/glibc.py
@@ -2,6 +2,7 @@
import os
import contextlib
from oeqa.core.decorator import OETestTag
+from oeqa.core.case import OEPTestResultTestCase
from oeqa.selftest.case import OESelftestTestCase
from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars, runqemu, Command
from oeqa.utils.nfs import unfs_server
@@ -13,7 +14,7 @@ def parse_values(content):
yield i[len(v) + 2:].strip(), v
break
-class GlibcSelfTestBase(OESelftestTestCase):
+class GlibcSelfTestBase(OESelftestTestCase, OEPTestResultTestCase):
def run_check(self, ssh = None):
# configure ssh target
features = []
@@ -31,10 +32,10 @@ class GlibcSelfTestBase(OESelftestTestCase):
builddir = get_bb_var("B", "glibc-testsuite")
ptestsuite = "glibc-user" if ssh is None else "glibc"
- self.extraresults = {"ptestresult.sections" : {ptestsuite : {}}}
+ self.ptest_section(ptestsuite)
with open(os.path.join(builddir, "tests.sum"), "r") as f:
for test, result in parse_values(f):
- self.extraresults["ptestresult.{}.{}".format(ptestsuite, test)] = {"status" : result}
+ self.ptest_result(ptestsuite, test, result)
def run_check_emulated(self):
with contextlib.ExitStack() as s:
diff --git a/poky/meta/lib/oeqa/selftest/cases/imagefeatures.py b/poky/meta/lib/oeqa/selftest/cases/imagefeatures.py
index afc629f29..8213d63e3 100644
--- a/poky/meta/lib/oeqa/selftest/cases/imagefeatures.py
+++ b/poky/meta/lib/oeqa/selftest/cases/imagefeatures.py
@@ -161,7 +161,8 @@ class ImageFeatures(OESelftestTestCase):
sysroot = get_bb_var('STAGING_DIR_NATIVE', 'core-image-minimal')
result = runCmd('qemu-img info --output json %s' % image_path,
native_sysroot=sysroot)
- self.assertTrue(json.loads(result.output).get('format') == itype)
+ self.assertTrue(json.loads(result.output).get('format') == itype,
+ msg="Could not parse '%s'" % result.output)
def test_long_chain_conversion(self):
"""
diff --git a/poky/meta/lib/oeqa/selftest/cases/oescripts.py b/poky/meta/lib/oeqa/selftest/cases/oescripts.py
index 7770b66a2..c169885cf 100644
--- a/poky/meta/lib/oeqa/selftest/cases/oescripts.py
+++ b/poky/meta/lib/oeqa/selftest/cases/oescripts.py
@@ -3,10 +3,12 @@
#
import os
+import shutil
import unittest
from oeqa.selftest.case import OESelftestTestCase
from oeqa.selftest.cases.buildhistory import BuildhistoryBase
from oeqa.utils.commands import Command, runCmd, bitbake, get_bb_var, get_test_layer
+from oeqa.utils import CommandError
class BuildhistoryDiffTests(BuildhistoryBase):
@@ -63,3 +65,59 @@ class OEPybootchartguyTests(OEScriptTests):
runCmd('%s/pybootchartgui/pybootchartgui.py %s -o %s/charts -f pdf' % (self.scripts_dir, self.buildstats, self.tmpdir))
self.assertTrue(os.path.exists(self.tmpdir + "/charts.pdf"))
+class OEGitproxyTests(OESelftestTestCase):
+
+ scripts_dir = os.path.join(get_bb_var('COREBASE'), 'scripts')
+
+ def test_oegitproxy_help(self):
+ try:
+ res = runCmd('%s/oe-git-proxy --help' % self.scripts_dir, assert_error=False)
+ self.assertTrue(False)
+ except CommandError as e:
+ self.assertEqual(2, e.retcode)
+
+ def run_oegitproxy(self, custom_shell=None):
+ os.environ['SOCAT'] = shutil.which("echo")
+ os.environ['ALL_PROXY'] = "https://proxy.example.com:3128"
+ os.environ['NO_PROXY'] = "*.example.com,.no-proxy.org,192.168.42.0/24,127.*.*.*"
+
+ if custom_shell is None:
+ prefix = ''
+ else:
+ prefix = custom_shell + ' '
+
+ # outside, use the proxy
+ res = runCmd('%s%s/oe-git-proxy host.outside-example.com 9418' %
+ (prefix,self.scripts_dir))
+ self.assertIn('PROXY:', res.output)
+ # match with wildcard suffix
+ res = runCmd('%s%s/oe-git-proxy host.example.com 9418' %
+ (prefix, self.scripts_dir))
+ self.assertIn('TCP:', res.output)
+ # match just suffix
+ res = runCmd('%s%s/oe-git-proxy host.no-proxy.org 9418' %
+ (prefix, self.scripts_dir))
+ self.assertIn('TCP:', res.output)
+ # match IP subnet
+ res = runCmd('%s%s/oe-git-proxy 192.168.42.42 9418' %
+ (prefix, self.scripts_dir))
+ self.assertIn('TCP:', res.output)
+ # match IP wildcard
+ res = runCmd('%s%s/oe-git-proxy 127.1.2.3 9418' %
+ (prefix, self.scripts_dir))
+ self.assertIn('TCP:', res.output)
+
+ # test that * globbering is off
+ os.environ['NO_PROXY'] = "*"
+ res = runCmd('%s%s/oe-git-proxy host.example.com 9418' %
+ (prefix, self.scripts_dir))
+ self.assertIn('TCP:', res.output)
+
+ def test_oegitproxy_proxy(self):
+ self.run_oegitproxy()
+
+ def test_oegitproxy_proxy_dash(self):
+ dash = shutil.which("dash")
+ if dash is None:
+ self.skipTest("No \"dash\" found on test system.")
+ self.run_oegitproxy(custom_shell=dash)
diff --git a/poky/meta/lib/oeqa/selftest/cases/runtime_test.py b/poky/meta/lib/oeqa/selftest/cases/runtime_test.py
index 20969d2c4..3f212bd0e 100644
--- a/poky/meta/lib/oeqa/selftest/cases/runtime_test.py
+++ b/poky/meta/lib/oeqa/selftest/cases/runtime_test.py
@@ -191,7 +191,7 @@ class TestImage(OESelftestTestCase):
features += 'TEST_SUITES = "ping ssh virgl"\n'
features += 'IMAGE_FEATURES_append = " ssh-server-dropbear"\n'
features += 'IMAGE_INSTALL_append = " kmscube"\n'
- features += 'TEST_RUNQEMUPARAMS = "gtk-gl"\n'
+ features += 'TEST_RUNQEMUPARAMS = "gtk gl"\n'
self.write_config(features)
bitbake('core-image-minimal')
bitbake('-c testimage core-image-minimal')
diff --git a/poky/meta/lib/oeqa/selftest/cases/wic.py b/poky/meta/lib/oeqa/selftest/cases/wic.py
index fcdd55059..ea7530040 100644
--- a/poky/meta/lib/oeqa/selftest/cases/wic.py
+++ b/poky/meta/lib/oeqa/selftest/cases/wic.py
@@ -632,8 +632,10 @@ class Wic2(WicTestCase):
# 1:0.00MiB:200MiB:200MiB:ext4::;\n
partlns = res.output.splitlines()[2:]
- self.assertEqual(1, len(partlns))
- self.assertEqual("1:0.00MiB:200MiB:200MiB:ext4::;", partlns[0])
+ self.assertEqual(1, len(partlns),
+ msg="Partition list '%s'" % res.output)
+ self.assertEqual("1:0.00MiB:200MiB:200MiB:ext4::;", partlns[0],
+ msg="Partition list '%s'" % res.output)
def test_fixed_size_error(self):
"""