Exemplo n.º 1
0
    def test_ptestrunner(self):
        self.add_smart_channel()
        (runnerstatus, result) = self.target.run('which ptest-runner', 0)
        cond = oeRuntimeTest.hasPackage(
            "ptest-runner") and oeRuntimeTest.hasFeature(
                "ptest") and oeRuntimeTest.hasPackage("-ptest") and (
                    runnerstatus != 0)
        if cond:
            self.install_packages(self.install_complementary("*-ptest"))
            self.install_packages(['ptest-runner'])

        (runnerstatus, result) = self.target.run(
            '/usr/bin/ptest-runner > /tmp/ptest.log 2>&1', 0)
        #exit code is !=0 even if ptest-runner executes because some ptest tests fail.
        self.assertTrue(runnerstatus != 127,
                        msg="Cannot execute ptest-runner!")
        self.target.copy_from('/tmp/ptest.log', self.ptest_log)
        shutil.copyfile(self.ptest_log, "ptest.log")

        result = self.parse_ptest("ptest.log")
        log_results_to_location = "./results"
        if os.path.exists(log_results_to_location):
            shutil.rmtree(log_results_to_location)
        os.makedirs(log_results_to_location)

        result.log_as_files(log_results_to_location,
                            test_status=['pass', 'fail'])
Exemplo n.º 2
0
def setUpModule():
    if not oeRuntimeTest.hasFeature("package-management"):
        skipModule("Image doesn't have package management feature")
    if not oeRuntimeTest.hasPackage("smartpm"):
        skipModule("Image doesn't have smart installed")
    if "package_rpm" != oeRuntimeTest.tc.d.getVar("PACKAGE_CLASSES", True).split()[0]:
        skipModule("Rpm is not the primary package manager")
Exemplo n.º 3
0
 def service_status(self, service):
     if oeRuntimeTest.hasFeature("systemd"):
         (status,
          output) = self.target.run('systemctl status -l %s' % service)
         return output
     else:
         return "Unable to get status or logs for %s" % service
Exemplo n.º 4
0
def setUpModule():
    if not oeRuntimeTest.hasFeature("package-management"):
        skipModule("Image doesn't have package management feature")
    if not oeRuntimeTest.hasPackage("smart"):
        skipModule("Image doesn't have smart installed")
    if "package_rpm" != oeRuntimeTest.tc.d.getVar("PACKAGE_CLASSES", True).split()[0]:
        skipModule("Rpm is not the primary package manager")
Exemplo n.º 5
0
def setUpModule():
    if not oeRuntimeTest.hasFeature("package-management"):
        skipModule(
            "rpm module skipped: target doesn't have package-management in IMAGE_FEATURES"
        )
    if "package_rpm" != oeRuntimeTest.tc.d.getVar("PACKAGE_CLASSES",
                                                  True).split()[0]:
        skipModule(
            "rpm module skipped: target doesn't have rpm as primary package manager"
        )
Exemplo n.º 6
0
    def test_ptestrunner(self):
        self.add_smart_channel()
        cond = oeRuntimeTest.hasPackage("ptest-runner") and oeRuntimeTest.hasFeature("ptest") and oeRuntimeTest.hasPackage("-ptest")
        if not cond:
            self.install_packages(self.install_complementary("*-ptest"))
            self.install_packages(['ptest-runner'])

        self.target.run('/usr/bin/ptest-runner > /tmp/ptest.log 2>&1', 0)
        self.target.copy_from('/tmp/ptest.log', self.ptest_log)
        shutil.copyfile(self.ptest_log, os.path.join(self.buildhist_dir, "ptest.log"))

        result = self.parse_ptest(os.path.join(self.buildhist_dir, "ptest.log"))
        log_results_to_location = "./results"
        if os.path.exists(log_results_to_location):
            shutil.rmtree(log_results_to_location)
        os.makedirs(log_results_to_location)

        result.log_as_files(log_results_to_location, test_status = ['fail'])
Exemplo n.º 7
0
    def test_ptestrunner(self):
        self.add_smart_channel()
        (runnerstatus, result) = self.target.run('which ptest-runner', 0)
        cond = oeRuntimeTest.hasPackage("ptest-runner") and oeRuntimeTest.hasFeature("ptest") and oeRuntimeTest.hasPackageMatch("-ptest") and (runnerstatus != 0)
        if cond:
            self.install_packages(self.install_complementary("*-ptest"))
            self.install_packages(['ptest-runner'])

        (runnerstatus, result) = self.target.run('/usr/bin/ptest-runner > /tmp/ptest.log 2>&1', 0)
        #exit code is !=0 even if ptest-runner executes because some ptest tests fail.
        self.assertTrue(runnerstatus != 127, msg="Cannot execute ptest-runner!")
        self.target.copy_from('/tmp/ptest.log', self.ptest_log)
        shutil.copyfile(self.ptest_log, "ptest.log")

        result = self.parse_ptest("ptest.log")
        log_results_to_location = "./results"
        if os.path.exists(log_results_to_location):
            shutil.rmtree(log_results_to_location)
        os.makedirs(log_results_to_location)

        result.log_as_files(log_results_to_location, test_status = ['pass','fail'])
Exemplo n.º 8
0
    def test_ptestrunner(self):
        self.add_smart_channel()
        cond = oeRuntimeTest.hasPackage(
            "ptest-runner") and oeRuntimeTest.hasFeature(
                "ptest") and oeRuntimeTest.hasPackage("-ptest")
        if not cond:
            self.install_packages(self.install_complementary("*-ptest"))
            self.install_packages(['ptest-runner'])

        self.target.run('/usr/bin/ptest-runner > /tmp/ptest.log 2>&1', 0)
        self.target.copy_from('/tmp/ptest.log', self.ptest_log)
        shutil.copyfile(self.ptest_log,
                        os.path.join(self.buildhist_dir, "ptest.log"))

        result = self.parse_ptest(os.path.join(self.buildhist_dir,
                                               "ptest.log"))
        log_results_to_location = "./results"
        if os.path.exists(log_results_to_location):
            shutil.rmtree(log_results_to_location)
        os.makedirs(log_results_to_location)

        result.log_as_files(log_results_to_location, test_status=['fail'])
Exemplo n.º 9
0
def setUpModule():
    if not oeRuntimeTest.hasFeature('smack'):
        skipModule(
            "smack module skipped: "
            "target doesn't have smack in DISTRO_FEATURES")
Exemplo n.º 10
0
def setUpModule():
    if not oeRuntimeTest.hasFeature("pam"):
        skipModule("target doesn't have 'pam' in DISTRO_FEATURES")
Exemplo n.º 11
0
def setUpModule():
    if not oeRuntimeTest.hasFeature("pam"):
        skipModule("target doesn't have 'pam' in DISTRO_FEATURES")
Exemplo n.º 12
0
def setUpModule():
    if not oeRuntimeTest.hasFeature("package-management"):
            skipModule("rpm module skipped: target doesn't have package-management in IMAGE_FEATURES")
    if "package_rpm" != oeRuntimeTest.tc.d.getVar("PACKAGE_CLASSES").split()[0]:
            skipModule("rpm module skipped: target doesn't have rpm as primary package manager")
Exemplo n.º 13
0
def setUpModule():
    if not oeRuntimeTest.hasFeature("x11-base"):
            skipModule("target doesn't have x11 in IMAGE_FEATURES")
Exemplo n.º 14
0
 def service_status(self, service):
     if oeRuntimeTest.hasFeature("systemd"):
         (status, output) = self.target.run("systemctl status -l %s" % service)
         return output
     else:
         return "Unable to get status or logs for %s" % service
Exemplo n.º 15
0
def setUpModule():
    if not oeRuntimeTest.hasFeature("tools-sdk"):
        skipModule("Image doesn't have tools-sdk in IMAGE_FEATURES")
Exemplo n.º 16
0
def setUpModule():
    if not oeRuntimeTest.hasFeature("tools-sdk"):
        skipModule("Image doesn't have tools-sdk in IMAGE_FEATURES")
Exemplo n.º 17
0
def setUpModule():
    if not oeRuntimeTest.hasFeature("package-management"):
        skipModule("Image doesn't have package management feature")
    if not oeRuntimeTest.hasPackage("smart"):
        skipModule("Image doesn't have smart installed")
Exemplo n.º 18
0
def setUpModule():
    if not oeRuntimeTest.hasFeature("x11-base"):
        skipModule("target doesn't have x11 in IMAGE_FEATURES")
Exemplo n.º 19
0
def setUpModule():
    if not oeRuntimeTest.hasFeature('smack'):
        skipModule("smack module skipped: "
                   "target doesn't have smack in DISTRO_FEATURES")
Exemplo n.º 20
0
def setUpModule():
    if not oeRuntimeTest.hasFeature('flatpak'):
        skipModule("flatpak not enabled, tests skipped")
Exemplo n.º 21
0
def setUpModule():
    if not oeRuntimeTest.hasFeature("systemd"):
        skipModule("target doesn't have systemd in DISTRO_FEATURES")
    if "systemd" != oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager"):
        skipModule("systemd is not the init manager for this image")
Exemplo n.º 22
0
def setUpModule():
    if not oeRuntimeTest.hasFeature("systemd"):
            skipModule("target doesn't have systemd in DISTRO_FEATURES")
    if "systemd" != oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager"):
            skipModule("systemd is not the init manager for this image")
Exemplo n.º 23
0
def setUpModule():
    if not oeRuntimeTest.hasFeature("package-management"):
        skipModule("Image doesn't have package management feature")
    if not oeRuntimeTest.hasPackage("smart"):
        skipModule("Image doesn't have smart installed")