Project

General

Profile

Actions

action #105732

closed

[sle][security][sle15sp4][swtpm] enhance current tpm2 related tests to use "swtpm" device

Added by rfan1 about 2 years ago. Updated about 2 years ago.

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

100%

Estimated time:
40.00 h
Difficulty:

Description

Description

Currently, we use ibmswtpm2 to emulate tpm devices.
http://openqa.suse.de/tests/8035101

We can enhance our test now via add a "swtpm" device via qemu emulator. it should make the test
more close to real customer environment.

Let me add some new test modules to implements.


Related issues 1 (0 open1 closed)

Copied to openQA Tests - action #106876: [sle][security][sle15sp4][swtpm] add tpm2 tests to arm platform [both tw and sle]Resolvedshawnhao2022-01-30

Actions
Actions #1

Updated by rfan1 about 2 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10
Actions #2

Updated by rfan1 about 2 years ago

Hit a new issue with swtpm device attached, if we define snapshot there, the rollback operation will try to kill the current qemu process and then start the VM again with snapshot.

however, the socket file will lost in this case [can reproduce with manual steps]

Let me try to enhance my test code to remove the rollback operation.

[2022-02-09T15:53:56.706039+01:00] [info] ::: consoles::serial_screen::read_until: Matched output from SUT in 2 loops & 0.000853997014928609 seconds: echo JLYr0; bash -oe pipefail /tmp/scriptJLYr0.sh ; echo SCRIPT_FINISHEDJLYr0-$?-
[2022-02-09T15:53:56.707002+01:00] [debug] >>> testapi::wait_serial: echo JLYr0; bash -oe pipefail /tmp/scriptJLYr0.sh ; echo SCRIPT_FINISHEDJLYr0-$?-: ok
[2022-02-09T15:53:56.707308+01:00] [debug] tests/security/tpm2/tpm2_engine/tpm2_engine_info.pm:25 called testapi::validate_script_output
[2022-02-09T15:53:56.707639+01:00] [debug] <<< testapi::wait_serial(timeout=30, record_output=1, no_regex=0, buffer_size=undef, regexp="SCRIPT_FINISHEDJLYr0-\\d+-", quiet=undef, expect_not_found=0)
[2022-02-09T15:53:56.708907+01:00] [debug] <<< consoles::serial_screen::read_until(quiet=undef, expect_not_found=0, buffer_size=undef, regexp="SCRIPT_FINISHEDJLYr0-\\d+-", no_regex=0, record_output=1, cmd="backend_wait_serial", pattern="SCRIPT_FINISHEDJLYr0-\\d+-", timeout=30, json_cmd_token="fZUNWCvl")
[2022-02-09T15:53:56.784924+01:00] [info] ::: consoles::serial_screen::read_until: Matched output from SUT in 5 loops & 0.0762789860018529 seconds: SCRIPT_FINISHEDJLYr0-0-
[2022-02-09T15:53:56.786195+01:00] [debug] >>> testapi::wait_serial: SCRIPT_FINISHEDJLYr0-\d+-: ok
[2022-02-09T15:53:56.792329+01:00] [debug] ||| finished tpm2_engine_info security/tpm2/tpm2_engine (runtime: 0 s)
[2022-02-09T15:53:56.794722+01:00] [debug] Loading a VM snapshot lastgood
[2022-02-09T15:53:56.797029+01:00] [debug] Loading snapshot (Current VM state is running)
[2022-02-09T15:53:56.821459+01:00] [debug] EVENT {"event":"STOP","timestamp":{"microseconds":820989,"seconds":1644418436}}
[2022-02-09T15:53:56.824796+01:00] [info] ::: OpenQA::Qemu::Proc::save_state: Saving QEMU state to qemu_state.json
[2022-02-09T15:53:57.861553+01:00] [debug] QEMU: qemu-system-x86_64: terminating on signal 15 from pid 27271 (/usr/bin/isotovideo: backen)
Actions #3

Updated by rfan1 about 2 years ago

Error messages:

[2022-02-11T09:53:12.716274+01:00] [debug] The built-in video encoder (pid 21670) terminated
[2022-02-11T09:53:12.716726+01:00] [debug] QEMU: QEMU emulator version 5.2.0 (SUSE Linux Enterprise 15)
[2022-02-11T09:53:12.716893+01:00] [debug] QEMU: Copyright (c) 2003-2020 Fabrice Bellard and the QEMU Project developers
[2022-02-11T09:53:12.717111+01:00] [warn] !!! : qemu-system-x86_64: -chardev socket,id=chrtpm,path=/tmp/mytpm1/swtpm-sock: Failed to connect to '/tmp/mytpm1/swtpm-sock': No such file or directory
[2022-02-11T09:53:12.717600+01:00] [debug] sending magic and exit
[2022-02-11T09:53:12.718430+01:00] [debug] received magic close
Use of uninitialized value $fname in concatenation (.) or string at /usr/lib/os-autoinst/log.pm line 66.
    log::fctwarn("THERE IS NOTHING TO READ 16 5 4") called at /usr/bin/isotovideo line 359
[2022-02-11T09:53:12.720561+01:00] [warn] !!! : THERE IS NOTHING TO READ 16 5 4
[2022-02-11T09:53:12.721023+01:00] [debug] stopping command server 21513 because test execution end
Actions #4

Updated by rfan1 about 2 years ago

  • % Done changed from 10 to 30

After removing the rollback operation, the tests passed:

https://openqa.suse.de/tests/8157351#details

Need regression test pass as well, let me do

Actions #5

Updated by rfan1 about 2 years ago

https://openqa.suse.de/tests/8168760#
Regress tests on sle passed

Actions #6

Updated by rfan1 about 2 years ago

  • % Done changed from 30 to 70
Actions #8

Updated by rfan1 about 2 years ago

  • Copied to action #106876: [sle][security][sle15sp4][swtpm] add tpm2 tests to arm platform [both tw and sle] added
Actions #9

Updated by rfan1 about 2 years ago

  • Status changed from In Progress to Feedback
Actions #10

Updated by rfan1 about 2 years ago

  • Status changed from Feedback to Resolved
  • % Done changed from 90 to 100

openqa daily job run passed

Actions

Also available in: Atom PDF