Minimal shell: honor full chain of hooks, on either minimal entry point #3377
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We have 2 points in which LISA might decide to go with a minimal shell profile:
When first contacting a node, issuing a 'cmd' command, checking if
'Windows' is present in the output or not (rule out Windows shell
type). A negative case will incur in either the POSIX shell type,
if 'Unknown syntax' is not thrown as output, or an early
decision for the 'minimal' shell type is taken and the shell object is
set to follow that config from there on.
When running the actual first lisa suite SSH command on the same
node. It turns out we've seen cases where 'Unknown syntax' is not
output at early node initialization (1), for some reason. Well, the
exception path of actual command execution will check internal node
state, that tracks if a minimal profile has been tested before or
not. If not used yet and under a command execution exception, set the
node to minimal type and try again was the logic.
It turns out the 'minification' of the node config was only done
partially, in (2). We missed the full logic of overriding its final
SSH command tokenizer.
Another missed detail is that the final tokenizer logic at the minimal
shell case was too greedy in trying to remove stray quotes. Let's keep
injecting quotes on tokens with spaces on them. That will not hurt any
legit commands from any minimal context.