oeqa/pam: Fix tests to work with busybox
PATCH 1/1 oeqa/pam: Fix tests to work with busybox
Distros may not use shadow for login manager
secondly login --help return 0 not 1 so adjust the check accordingly
--- meta/lib/oeqa/runtime/cases/pam.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
meta/lib/oeqa/runtime/cases/pam.py +6 -6
@@ -17,7 +17,7 @@ class PamBasicTest(OERuntimeTestCase): status, output = self.target.run('login --help') msg = ('login command does not work as expected. ' 'Status and output:%s and %s' % (status, output)) - self.assertEqual(status, 1, msg = msg) + self.assertEqual(status, 0, msg = msg) status, output = self.target.run('passwd --help') msg = ('passwd command does not work as expected. '
@@ -28,8 +28,8 @@ class PamBasicTest(OERuntimeTestCase): msg = ('su command does not work as expected. ' 'Status and output:%s and %s' % (status, output)) self.assertEqual(status, 0, msg = msg) - - status, output = self.target.run('useradd --help') - msg = ('useradd command does not work as expected. ' - 'Status and output:%s and %s' % (status, output)) - self.assertEqual(status, 0, msg = msg) + if self.tc.td.get('VIRTUAL-RUNTIME_login_manager') == 'shadow-base': + status, output = self.target.run('useradd --help') + msg = ('useradd command does not work as expected. ' + 'Status and output:%s and %s' % (status, output)) + self.assertEqual(status, 0, msg = msg)
Signature · 1 line
2.30.1
Quoted 16 lines · Khem Raj
Distros may not use shadow for login manager
secondly login --help return 0 not 1 so adjust the check accordinglySigned-off-by Khem Raj <[email protected]>---
meta/lib/oeqa/runtime/cases/pam.py | 12 ++++++------1 file changed, 6 insertions(+), 6 deletions(-)meta/lib/oeqa/runtime/cases/pam.py +0
-0@@ -17,7 +17,7 @@ class PamBasicTest(OERuntimeTestCase): status, output = self.target.run('login --help')msg = ('login command does not work as expected. ' 'Status and output:%s and %s' % (status, output))
meta/lib/oeqa/runtime/cases/pam.py class PamBasicTest(OERuntimeTestCase): · line 20
Quoted 2 lines
meta/lib/oeqa/runtime/cases/pam.py +1
-1- self.assertEqual(status, 1, msg = msg) + self.assertEqual(status, 0, msg = msg)
Surely just changing the exit status to the opposite will cause the autobuilder to fail this instead?
Cheers,
Richard
yeah I realized that it should be rather skipped when shadow and shadow-base is missing in image
sent a v2
Quoted 28 lines · Richard Purdie
Quoted 13 lines · Khem Raj
Distros may not use shadow for login manager
secondly login --help return 0 not 1 so adjust the check accordinglySigned-off-by Khem Raj <[email protected]>--- meta/lib/oeqa/runtime/cases/pam.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)meta/lib/oeqa/runtime/cases/pam.py +0
-0meta/lib/oeqa/runtime/cases/pam.py class PamBasicTest(OERuntimeTestCase): · line 20
Quoted 5 lines
meta/lib/oeqa/runtime/cases/pam.py +1
-1@@ -17,7 +17,7 @@ class PamBasicTest(OERuntimeTestCase): status, output = self.target.run('login --help') msg = ('login command does not work as expected. ' 'Status and output:%s and %s' % (status, output)) - self.assertEqual(status, 1, msg = msg) + self.assertEqual(status, 0, msg = msg)Surely just changing the exit status to the opposite will cause the autobuilder to fail this instead?
Cheers,
Richard