xref: /openbmc/openbmc/poky/meta/lib/oeqa/runtime/cases/df.py (revision 92b42cb35d755f8cfe6c17d403711a536e0f0721)
1#
2# Copyright OpenEmbedded Contributors
3#
4# SPDX-License-Identifier: MIT
5#
6
7from oeqa.runtime.case import OERuntimeTestCase
8from oeqa.core.decorator.depends import OETestDepends
9from oeqa.core.decorator.data import skipIfDataVar, skipIfInDataVar
10from oeqa.runtime.decorator.package import OEHasPackage
11
12class DfTest(OERuntimeTestCase):
13
14    @OETestDepends(['ssh.SSHTest.test_ssh'])
15    @OEHasPackage(['coreutils', 'busybox'])
16    @skipIfInDataVar('IMAGE_FEATURES', 'read-only-rootfs', 'Test case df requires a writable rootfs')
17    def test_df(self):
18        cmd = "df -P / | sed -n '2p' | awk '{print $4}'"
19        (status,output) = self.target.run(cmd)
20        msg = 'Not enough space on image. Current size is %s' % output
21        self.assertTrue(int(output)>5120, msg=msg)
22