| Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 1 | # | 
| Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 2 | # Copyright OpenEmbedded Contributors | 
 | 3 | # | 
| Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 4 | # SPDX-License-Identifier: MIT | 
 | 5 | # | 
 | 6 |  | 
| Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 7 | from oeqa.runtime.case import OERuntimeTestCase | 
 | 8 | from oeqa.core.decorator.depends import OETestDepends | 
| Andrew Geissler | 9b4d8b0 | 2021-02-19 12:26:16 -0600 | [diff] [blame] | 9 | from oeqa.core.decorator.data import skipIfDataVar, skipIfInDataVar | 
| Brad Bishop | 977dc1a | 2019-02-06 16:01:43 -0500 | [diff] [blame] | 10 | from oeqa.runtime.decorator.package import OEHasPackage | 
| Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 11 |  | 
 | 12 | class DfTest(OERuntimeTestCase): | 
 | 13 |  | 
| Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 14 |     @OETestDepends(['ssh.SSHTest.test_ssh']) | 
| Brad Bishop | 977dc1a | 2019-02-06 16:01:43 -0500 | [diff] [blame] | 15 |     @OEHasPackage(['coreutils', 'busybox']) | 
| Andrew Geissler | 9b4d8b0 | 2021-02-19 12:26:16 -0600 | [diff] [blame] | 16 |     @skipIfInDataVar('IMAGE_FEATURES', 'read-only-rootfs', 'Test case df requires a writable rootfs') | 
| Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 17 |     def test_df(self): | 
| Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame] | 18 |         cmd = "df -P / | sed -n '2p' | awk '{print $4}'" | 
| Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 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) |