openbmc / openbmc-test-automation

Apache License 2.0
100 stars 92 forks source link

Plug-in setup failed error with Verify_Redfish_User_Persistence_After_Reboot test #2208

Closed ansaj closed 1 year ago

ansaj commented 1 year ago

Verify Redfish User Persistence After Reboot [Documentation] Verify Redfish user persistence after reboot. [Tags] Verify_Redfish_User_Persistence_After_Reboot

# Create Redfish users.
Redfish Create User  admin_user     TestPwd123  Administrator   ${True}
Redfish Create User  operator_user  TestPwd123  Operator        ${True}
Redfish Create User  readonly_user  TestPwd123  ReadOnly        ${True}

# Reboot BMC.
Redfish OBMC Reboot (off)  stack_mode=skip

# Verify users after reboot.
Redfish Verify User  admin_user     TestPwd123  Administrator   ${True}
Redfish Verify User  operator_user  TestPwd123  Operator        ${True}
Redfish Verify User  readonly_user  TestPwd123  ReadOnly        ${True}

# Delete created users.
Redfish.Delete  /redfish/v1/AccountService/Accounts/admin_user
Redfish.Delete  /redfish/v1/AccountService/Accounts/operator_user
Redfish.Delete  /redfish/v1/AccountService/Accounts/readonly_user

setup() in openbmc-test-automation/lib/obmc_boot_test.py fails.

gkeishin commented 1 year ago

It looks un-related failure. Run the test with this option and give a try @ansaj

-v REDFISH_SUPPORT_TRANS_STATE:1

and if you are running for the first time

Installing expect:

$ sudo apt-get install expect (Ubuntu example)
ansaj commented 1 year ago

Thanks @gkeishin - I installed 'expect' and ran the test with -v REDFISH_SUPPORT_TRANS_STATE:1 but still seeing the same Plug-in setup failed issue. Is there any documentation available on how to troubleshoot this issue?

gkeishin commented 1 year ago

Maybe if u can paste a snippet of the failure, I can take a look.

In the meantime, assuming you have done the installation procedure https://github.com/openbmc/openbmc-test-automation#installation-setup-guide

run this if it works for u clean

robot -v OPENBMC_HOST:xx.xx.xx.xx -v REDFISH_SUPPORT_TRANS_STATE:1 templates/test_openbmc_setup.robot
ansaj commented 1 year ago

test_openbmc_setup.robot comes out clean. I narrowed down the issue to symlinks in /bin/plug_ins/Auto_reboot/. After fixing the symlinks test works fine. Thanks!

gkeishin commented 1 year ago

Thank you @ansaj

gkeishin commented 1 year ago

Can you close this ticket here. Thanks

nba2023 commented 2 months ago

test_openbmc_setup.robot comes out clean. I narrowed down the issue to symlinks in /bin/plug_ins/Auto_reboot/. After fixing the symlinks test works fine. Thanks!

Would you describe more details for this fixing? I had the similar error. The console error messages as follows:

------------------------------------------------- Starting plug-in -----------------------------------------------
#(UTC) 2024/05/23 06:43:42.939319 -    0.147426 - Running Auto_reboot/cp_setup.
#(UTC) 2024/05/23 06:43:42.939790 -    0.000471 - Issuing: PATH=/openbmc/bin/plug_ins/Auto_reboot:${PATH}
#(UTC) 2024/05/23 06:43:42.939920 -    0.000129 - Issuing: auto_status_file.py --status_dir_path=/openbmc/logs/ --status_file_name=192.168.x.x.Auto_reboot.cp_setup.240523.064342.status --quiet=1 --show_url=1 --prefix=192.168.x.x.Auto_reboot.cp_setup --stdout=0 cp_setup
status_file_path:                                 /openbmc/logs/192.168.x.x.Auto_reboot.cp_setup.240523.064342.status
enable_auto_reboot:                               0
========================================================================================================================
#(UTC) 2024/05/23 06:43:44.847217 -    0.852431 - **ERROR** The prior shell command failed.
attempt_num:                                      1
command_string:                                   for program in python robot ; do dirname $(${program} --print_only) ; done 2>/dev/null
command_timed_out:                                False
time_out:                                         None
child_pid:                                        213
shell_rc:                                         0x0000000000000001
valid_rcs:
  [0]:                                            0x0000000000000000
stdout_buf:

  --------------------------------------------------------------------------------
  Python function call stack

  Line # Function name and arguments
  ------ -------------------------------------------------------------------------
     502 shell_cmd(command_string = 'for program in python robot ; do dirname $(${program} --print_only) ; done 2>/dev/null', quiet = 1, print_output = 0, show_err = 1, ...
     112 robot_cmd_fnc(robot_cmd_buf = "robot -v OPENBMC_HOST:192.168.x.x -v SSH_PORT:22 -v HTTPS_PORT:443 -v OPENBMC_USERNAME:root -v OPENBMC_PASSWORD:0penBmc -v IPMI_...
     121 main()
         /openbmc/bin/plug_ins/Auto_reboot/cp_master
  --------------------------------------------------------------------------------

  #(UTC) 2024/05/23 06:43:44.848257 -    0.001041 - Running cp_master.
  #(UTC) 2024/05/23 06:43:44.848330 -    0.000073 - Program parameter values, etc.:

  command_line:                                     /openbmc/bin/plug_ins/Auto_reboot/cp_master
  cp_master_pid:                                    203
  cp_master_pgid:                                   1
  uid:                                              0 (root)
  gid:                                              0 (root)
  host_name:                                        test-vm
  DISPLAY:
  python_version:                                   3.6.9 (default, Mar 10 2023, 16:46:00) [GCC 8.4.0]
  test_mode:                                        0
  quiet:                                            1
  debug:                                            0

========================================================================================================================
**ERROR** select_version should never be called directly.  Only links to select_version should be called.
Traceback (most recent call last):
  File "/openbmc/bin/plug_ins/Auto_reboot/cp_master", line 121, in <module>
    main()
  File "/openbmc/bin/plug_ins/Auto_reboot/cp_master", line 112, in main
    while not robot_cmd_fnc(cmd_buf):
  File "/openbmc/lib/gen_call_robot.py", line 558, in robot_cmd_fnc
    process_robot_output_files()
  File "/openbmc/lib/gen_call_robot.py", line 370, in process_robot_output_files
    outputdir = robot_cmd_buf_dict["outputdir"]
KeyError: 'outputdir'

auto_status_file_ret_code:                        1
status_file_path:                                 /openbmc/logs/192.168.x.x.Auto_reboot.cp_setup.240523.064342.status
------------------------------------------------- Ending plug-in -------------------------------------------------
failed_plug_in_name:                              Auto_reboot/cp_setup
shell_rc:                                         0x0000000000000100
#(UTC) 2024/05/23 06:43:45.185797 -    2.245878 - **ERROR** At least one plug-in failed.
proc_plug_pkg_rc:                                 0x0000000000000001
#(UTC) 2024/05/23 06:43:45.302874 -    5.771431 - Re-cap of plug-in failures:
failed_plug_in_name:                              Auto_reboot/cp_setup
shell_rc:                                         0x0000000000000100
#(UTC) 2024/05/23 06:43:45.371776 -    0.068902 - **ERROR** Plug-in setup failed.
Plug-in setup failed.

#(UTC) 2024/05/23 06:43:45.485862 -    0.114087 - Issuing: ipmitool -I lanplus -C 17 -N 5 -p 623 -U root -P ******** -H 192.168.x.x chassis status
| FAIL |
Plug-in setup failed.