blob: 43e0ebf9eaa762250547eff5dadb23e1c183357f [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001#
Patrick Williams92b42cb2022-09-03 06:53:57 -05002# Copyright OpenEmbedded Contributors
3#
Brad Bishopc342db32019-05-15 21:57:59 -04004# SPDX-License-Identifier: MIT
5#
6
Brad Bishop6e60e8b2018-02-01 10:27:11 -05007from oeqa.runtime.case import OERuntimeTestCase
8from oeqa.core.decorator.depends import OETestDepends
Andrew Geissler9b4d8b02021-02-19 12:26:16 -06009from oeqa.core.decorator.data import skipIfDataVar, skipIfInDataVar
Brad Bishop977dc1a2019-02-06 16:01:43 -050010from oeqa.runtime.decorator.package import OEHasPackage
Brad Bishop6e60e8b2018-02-01 10:27:11 -050011
12class DfTest(OERuntimeTestCase):
13
Brad Bishop6e60e8b2018-02-01 10:27:11 -050014 @OETestDepends(['ssh.SSHTest.test_ssh'])
Brad Bishop977dc1a2019-02-06 16:01:43 -050015 @OEHasPackage(['coreutils', 'busybox'])
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060016 @skipIfInDataVar('IMAGE_FEATURES', 'read-only-rootfs', 'Test case df requires a writable rootfs')
Brad Bishop6e60e8b2018-02-01 10:27:11 -050017 def test_df(self):
Brad Bishop64c979e2019-11-04 13:55:29 -050018 cmd = "df -P / | sed -n '2p' | awk '{print $4}'"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050019 (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)