Skip to content

Conversation

@marc-hb
Copy link
Collaborator

@marc-hb marc-hb commented Sep 8, 2020

On my system sudo fails to use cached credentials when invoked from
"expect" for some unknown reason. Rather than debugging this, let's
replace the 9 lines long expect test with a much simpler one-line "sudo
--non-interactive" test which works perfectly.

Signed-off-by: Marc Herbert marc.herbert@intel.com

On my system sudo fails to use cached credentials when invoked from
"expect" for some unknown reason. Rather than debugging this, let's
replace the 9 lines long expect test with a much simpler one-line "sudo
--non-interactive" test which works perfectly.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
@marc-hb marc-hb marked this pull request as ready for review September 9, 2020 00:51
@marc-hb marc-hb requested a review from a team as a code owner September 9, 2020 00:51
@xiulipan
Copy link
Contributor

xiulipan commented Sep 9, 2020

@marc-hb From your fix for the lib also see #366 , I have some proposal for unit test for lib #370
Could you try to have some test scripts for our lib? You can start with those 2 fail case you found first. This will make sure our future change do not bring regression.

@marc-hb
Copy link
Collaborator Author

marc-hb commented Sep 9, 2020

I'm not sure I understand the scope of #370 . In the mean time can you please review this? It merely replaces a complex, 9 lines-long expect script that doesn't work with a dead simple one-line sudo invocation that does.

Copy link
Contributor

@xiulipan xiulipan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some simple question here, do we need to exit 1 here?


# Test for either cached credentials or NOPASSWD
if $SUDO_CMD --non-interactive true
then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need else here to exit 1?

Copy link
Collaborator Author

@marc-hb marc-hb Sep 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exit I removed were expect commands, not shell commands.

@xiulipan xiulipan merged commit 0816cc8 into thesofproject:master Sep 10, 2020
@marc-hb marc-hb deleted the sudo-nopass-fix branch October 22, 2020 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants