summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Freihofer <adrian.freihofer@siemens.com>2025-07-12 15:06:36 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-07-14 17:49:48 +0100
commit55239572a41842ed91eab8f1123ceb4a0a60c83a (patch)
tree69d48dda183da1e0aee23bf963d9c7b5ad862727
parent322fc2fc75ab9a4142693897639245fea834ab8d (diff)
downloadpoky-55239572a41842ed91eab8f1123ceb4a0a60c83a.tar.gz
oe-selftest: devtool deploy-target test --strip option
Extend the devtool deploy-target test to test with and without the --strip option. The --strip code path recently broke unnoticed because of changes in pseudo. (From OE-Core rev: 4c586320e15d8d8b5b85e2da0b900dcc6a0fff3d) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/selftest/cases/devtool.py63
1 files changed, 33 insertions, 30 deletions
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py
index 05f228f03e..4f02f4b68b 100644
--- a/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -1839,36 +1839,39 @@ class DevtoolDeployTargetTests(DevtoolBase):
1839 # Boot the image 1839 # Boot the image
1840 with runqemu(testimage) as qemu: 1840 with runqemu(testimage) as qemu:
1841 # Now really test deploy-target 1841 # Now really test deploy-target
1842 result = runCmd('devtool deploy-target -c %s root@%s' % (testrecipe, qemu.ip)) 1842 for extra_opt in ['', '--strip']:
1843 # Run a test command to see if it was installed properly 1843 deploy_cmd= 'devtool deploy-target -c %s root@%s %s' % (testrecipe, qemu.ip, extra_opt)
1844 sshargs = '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' 1844 self.logger.debug(deploy_cmd)
1845 result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand)) 1845 result = runCmd(deploy_cmd)
1846 # Check if it deployed all of the files with the right ownership/perms 1846 # Run a test command to see if it was installed properly
1847 # First look on the host - need to do this under pseudo to get the correct ownership/perms 1847 sshargs = '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
1848 bb_vars = get_bb_vars(['D', 'FAKEROOTENV', 'FAKEROOTCMD'], testrecipe) 1848 result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand))
1849 installdir = bb_vars['D'] 1849 # Check if it deployed all of the files with the right ownership/perms
1850 fakerootenv = bb_vars['FAKEROOTENV'] 1850 # First look on the host - need to do this under pseudo to get the correct ownership/perms
1851 fakerootcmd = bb_vars['FAKEROOTCMD'] 1851 bb_vars = get_bb_vars(['D', 'FAKEROOTENV', 'FAKEROOTCMD'], testrecipe)
1852 result = runCmd('%s %s find . -type f -exec ls -l {} \\;' % (fakerootenv, fakerootcmd), cwd=installdir) 1852 installdir = bb_vars['D']
1853 filelist1 = self._process_ls_output(result.output) 1853 fakerootenv = bb_vars['FAKEROOTENV']
1854 1854 fakerootcmd = bb_vars['FAKEROOTCMD']
1855 # Now look on the target 1855 result = runCmd('%s %s find . -type f -exec ls -l {} \\;' % (fakerootenv, fakerootcmd), cwd=installdir)
1856 tempdir2 = tempfile.mkdtemp(prefix='devtoolqa') 1856 filelist1 = self._process_ls_output(result.output)
1857 self.track_for_cleanup(tempdir2) 1857
1858 tmpfilelist = os.path.join(tempdir2, 'files.txt') 1858 # Now look on the target
1859 with open(tmpfilelist, 'w') as f: 1859 tempdir2 = tempfile.mkdtemp(prefix='devtoolqa')
1860 for line in filelist1: 1860 self.track_for_cleanup(tempdir2)
1861 splitline = line.split() 1861 tmpfilelist = os.path.join(tempdir2, 'files.txt')
1862 f.write(splitline[-1] + '\n') 1862 with open(tmpfilelist, 'w') as f:
1863 result = runCmd('cat %s | ssh -q %s root@%s \'xargs ls -l\'' % (tmpfilelist, sshargs, qemu.ip)) 1863 for line in filelist1:
1864 filelist2 = self._process_ls_output(result.output) 1864 splitline = line.split()
1865 filelist1.sort(key=lambda item: item.split()[-1]) 1865 f.write(splitline[-1] + '\n')
1866 filelist2.sort(key=lambda item: item.split()[-1]) 1866 result = runCmd('cat %s | ssh -q %s root@%s \'xargs ls -l\'' % (tmpfilelist, sshargs, qemu.ip))
1867 self.assertEqual(filelist1, filelist2) 1867 filelist2 = self._process_ls_output(result.output)
1868 # Test undeploy-target 1868 filelist1.sort(key=lambda item: item.split()[-1])
1869 result = runCmd('devtool undeploy-target -c %s root@%s' % (testrecipe, qemu.ip)) 1869 filelist2.sort(key=lambda item: item.split()[-1])
1870 result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand), ignore_status=True) 1870 self.assertEqual(filelist1, filelist2)
1871 self.assertNotEqual(result, 0, 'undeploy-target did not remove command as it should have') 1871 # Test undeploy-target
1872 result = runCmd('devtool undeploy-target -c %s root@%s' % (testrecipe, qemu.ip))
1873 result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand), ignore_status=True)
1874 self.assertNotEqual(result, 0, 'undeploy-target did not remove command as it should have')
1872 1875
1873class DevtoolBuildImageTests(DevtoolBase): 1876class DevtoolBuildImageTests(DevtoolBase):
1874 1877