aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/runtime/cases/lsb.py
blob: 0ad4f9bafa8d2c86dc198edc4b52efa2f621b615 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# LSB compliance runtime
#
# Copyright (c) 2019 MontaVista Software, LLC
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# This program is distributed in the hope it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
# more details.
#

import time
import datetime
import bb

from oeqa.runtime.case import OERuntimeTestCase
from oeqa.core.decorator.depends import OETestDepends
from oeqa.runtime.decorator.package import OEHasPackage

class LSBTest(OERuntimeTestCase):

    @OETestDepends(['ssh.SSHTest.test_ssh'])
    @OEHasPackage(["lsbtest", 'rpm', 'perl-mouldes'])
    def test_lsb_test(self):
        bb.warn("lsb-test")
        cmd = "sh /opt/lsb-test/LSB_Test.sh"
        bb.warn("%s" % cmd)
        starttime = time.time()
        (status, output) = self.target.run(cmd, 100)
        endtime = time.time()
        runtime = int(endtime - starttime)
        bb.warn("lsb: %s %s" % (output, runtime))