Actions
action #45785
closed[security] Interactive command support as an utils function
Start date:
2019-01-08
Due date:
% Done:
0%
Estimated time:
Difficulty:
Description
Background¶
- Some commands only can be used within interactive mode, eg. passwd, aa-genprof.
- Sometime we really want to test the interactive mode.
- As a workaround, tool 'expect' can be used but need some programming, and openQA can not participate in the test action during expect running. That is not what we prefer.
So, it is reasonable to provide a function which wrap all the common process for interactive command calling.
Issue to be solved¶
- There are multiple "Question prompts" and "Answers" to be handled, the action should be done according to serial output in the run time.
- The pipe buffer should be disabled, otherwise the command prompt message can not be passed to the serial console in run time.
Approaches¶
- A loop with a string as a flag for the end of interactive command, can be used to deal with multiple prompts and answer action.
- The 'typescript' tool can be used to disable pipe buffer for any commands.
- A 'timeout' should be given for each interactive prompts.
Reference¶
Some exist cases have already implemented it:
lib/apparmortest.pm
called bytests/security/apparmor/aa_autodep.pm
feature/feature_console/zypper_releasever.pm
Updated by whdu over 5 years ago
- Status changed from Workable to In Progress
- Assignee set to whdu
Updated by whdu over 5 years ago
- Related to action #45803: [sle][security][sle15sp1] Modify apparmor cases to disable pipe buffer with new method added
Updated by agraul over 5 years ago
- Subject changed from Interactive command support as an utils function to [security] Interactive command support as an utils function
- Category set to Infrastructure
Updated by okurz over 5 years ago
- Category changed from Infrastructure to Enhancement to existing tests
Actions