Project

General

Profile

Actions

action #45785

closed

[security] Interactive command support as an utils function

Added by whdu over 5 years ago. Updated over 5 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Enhancement to existing tests
Target version:
-
Start date:
2019-01-08
Due date:
% Done:

0%

Estimated time:
Difficulty:

Description

Background

  1. Some commands only can be used within interactive mode, eg. passwd, aa-genprof.
  2. Sometime we really want to test the interactive mode.
  3. 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

  1. There are multiple "Question prompts" and "Answers" to be handled, the action should be done according to serial output in the run time.
  2. The pipe buffer should be disabled, otherwise the command prompt message can not be passed to the serial console in run time.

Approaches

  1. 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.
  2. The 'typescript' tool can be used to disable pipe buffer for any commands.
  3. A 'timeout' should be given for each interactive prompts.

Reference

Some exist cases have already implemented it:

  • lib/apparmortest.pm called by tests/security/apparmor/aa_autodep.pm
  • feature/feature_console/zypper_releasever.pm

Related issues 1 (0 open1 closed)

Related to openQA Tests - action #45803: [sle][security][sle15sp1] Modify apparmor cases to disable pipe buffer with new methodResolvedwhdu2019-01-08

Actions
Actions

Also available in: Atom PDF