diff options
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/buildperf/base.py | 9 | ||||
-rw-r--r-- | meta/lib/oeqa/buildperf/test_basic.py | 6 |
2 files changed, 11 insertions, 4 deletions
diff --git a/meta/lib/oeqa/buildperf/base.py b/meta/lib/oeqa/buildperf/base.py index 2c102554b9..59dd02521c 100644 --- a/meta/lib/oeqa/buildperf/base.py +++ b/meta/lib/oeqa/buildperf/base.py | |||
@@ -408,9 +408,14 @@ class BuildPerfTestCase(unittest.TestCase): | |||
408 | int((e_sec % 3600) / 60), | 408 | int((e_sec % 3600) / 60), |
409 | e_sec % 60)) | 409 | e_sec % 60)) |
410 | 410 | ||
411 | def measure_disk_usage(self, path, name, legend): | 411 | def measure_disk_usage(self, path, name, legend, apparent_size=False): |
412 | """Estimate disk usage of a file or directory""" | 412 | """Estimate disk usage of a file or directory""" |
413 | ret = runCmd2(['du', '-s', path]) | 413 | cmd = ['du', '-s', '--block-size', '1024'] |
414 | if apparent_size: | ||
415 | cmd.append('--apparent-size') | ||
416 | cmd.append(path) | ||
417 | |||
418 | ret = runCmd2(cmd) | ||
414 | size = int(ret.output.split()[0]) | 419 | size = int(ret.output.split()[0]) |
415 | log.debug("Size of %s path is %s", path, size) | 420 | log.debug("Size of %s path is %s", path, size) |
416 | measurement = {'type': self.DISKUSAGE, | 421 | measurement = {'type': self.DISKUSAGE, |
diff --git a/meta/lib/oeqa/buildperf/test_basic.py b/meta/lib/oeqa/buildperf/test_basic.py index e448ed18c9..7a48c1e77f 100644 --- a/meta/lib/oeqa/buildperf/test_basic.py +++ b/meta/lib/oeqa/buildperf/test_basic.py | |||
@@ -114,7 +114,8 @@ class Test4(BuildPerfTestCase): | |||
114 | self.bb_vars['SDK_DEPLOY'], | 114 | self.bb_vars['SDK_DEPLOY'], |
115 | self.bb_vars['TOOLCHAINEXT_OUTPUTNAME'] + '.sh') | 115 | self.bb_vars['TOOLCHAINEXT_OUTPUTNAME'] + '.sh') |
116 | # Measure installer size | 116 | # Measure installer size |
117 | self.measure_disk_usage(installer, 'installer_bin', 'eSDK installer') | 117 | self.measure_disk_usage(installer, 'installer_bin', 'eSDK installer', |
118 | apparent_size=True) | ||
118 | # Measure deployment time and deployed size | 119 | # Measure deployment time and deployed size |
119 | deploy_dir = os.path.join(tmp_dir, 'esdk-deploy') | 120 | deploy_dir = os.path.join(tmp_dir, 'esdk-deploy') |
120 | if os.path.exists(deploy_dir): | 121 | if os.path.exists(deploy_dir): |
@@ -122,4 +123,5 @@ class Test4(BuildPerfTestCase): | |||
122 | self.sync() | 123 | self.sync() |
123 | self.measure_cmd_resources([installer, '-y', '-d', deploy_dir], | 124 | self.measure_cmd_resources([installer, '-y', '-d', deploy_dir], |
124 | 'deploy', 'eSDK deploy') | 125 | 'deploy', 'eSDK deploy') |
125 | self.measure_disk_usage(deploy_dir, 'deploy_dir', 'deploy dir') | 126 | self.measure_disk_usage(deploy_dir, 'deploy_dir', 'deploy dir', |
127 | apparent_size=True) | ||