blob: bb155c9cf98c1d73760bbfa699fc4ad39e2cf0aa [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001#
2# SPDX-License-Identifier: MIT
3#
4
Brad Bishop6e60e8b2018-02-01 10:27:11 -05005from oeqa.runtime.case import OERuntimeTestCase
6from oeqa.core.decorator.depends import OETestDepends
Andrew Geissler9b4d8b02021-02-19 12:26:16 -06007from oeqa.core.decorator.data import skipIfDataVar, skipIfInDataVar
Brad Bishop977dc1a2019-02-06 16:01:43 -05008from oeqa.runtime.decorator.package import OEHasPackage
Brad Bishop6e60e8b2018-02-01 10:27:11 -05009
10class DfTest(OERuntimeTestCase):
11
Brad Bishop6e60e8b2018-02-01 10:27:11 -050012 @OETestDepends(['ssh.SSHTest.test_ssh'])
Brad Bishop977dc1a2019-02-06 16:01:43 -050013 @OEHasPackage(['coreutils', 'busybox'])
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060014 @skipIfInDataVar('IMAGE_FEATURES', 'read-only-rootfs', 'Test case df requires a writable rootfs')
Brad Bishop6e60e8b2018-02-01 10:27:11 -050015 def test_df(self):
Brad Bishop64c979e2019-11-04 13:55:29 -050016 cmd = "df -P / | sed -n '2p' | awk '{print $4}'"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050017 (status,output) = self.target.run(cmd)
18 msg = 'Not enough space on image. Current size is %s' % output
19 self.assertTrue(int(output)>5120, msg=msg)