robottelo
robottelo copied to clipboard
Test leapp upgrade with non-admin user BZ#2257302
Problem Statement
Missing scenario of Leapp client upgrade from non-admin user
Solution
Added test scenario to test BZ#2257302
Related Issues
trigger: test-robottelo pytest: tests/foreman/cli/test_leapp_client.py -k test_leapp_upgrade_rhel_non_admin
PRT Result
Build Number: 5735
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/cli/test_leapp_client.py -k test_leapp_upgrade_rhel_non_admin
Test Result : ========== 1 passed, 1 deselected, 11 warnings in 3009.08s (0:50:09) ===========
trigger: test-robottelo pytest: tests/foreman/cli/test_leapp_client.py -k test_leapp_upgrade_rhel_non_admin
PRT Result
Build Number: 5839
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/cli/test_leapp_client.py -k test_leapp_upgrade_rhel_non_admin
Test Result : ========== 1 failed, 1 deselected, 11 warnings in 2054.09s (0:34:14) ===========
trigger: test-robottelo pytest: tests/foreman/cli/test_leapp_client.py -k test_leapp_upgrade_rhel_non_admin
PRT Result
Build Number: 5855
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/cli/test_leapp_client.py -k test_leapp_upgrade_rhel_non_admin
Test Result : ====== 1 failed, 1 deselected, 11 warnings, 1 error in 2828.30s (0:47:08) ======
trigger: test-robottelo pytest: tests/foreman/cli/test_leapp_client.py -k test_leapp_upgrade_rhel_non_admin
PRT Result
Build Number: 5858
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/cli/test_leapp_client.py -k test_leapp_upgrade_rhel_non_admin
Test Result : ====== 1 failed, 1 deselected, 11 warnings, 1 error in 2906.87s (0:48:26) ======
PRT Result
Build Number: 5862
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/cli/test_leapp_client.py -k test_leapp_upgrade_rhel_non_admin
Test Result : ====== 1 failed, 1 deselected, 11 warnings, 1 error in 3031.22s (0:50:31) ======
Looks ~OK but consider these:
1. don't make another test, make it a parameter of the original test whether the user is/is not an admin
There are 2 reasons because of which I did not make this parametrized with the existing test, first is there are more actions for non-admin user to make it parametrized which will just make it complicated. The second reason is I wanted to have the first test to mark it for end_to_end and upgrade so created different test to cover this scenario. 2. we usually prefix tests with
test_positive
ortest_negative
This I can improve in the test name.
I tried to compare this new (non-admin) test with the original (admin) one and I see some differences...
-
The original test uses flag reboot=True, but new one has reboot=False. And what is Channel flag for? I think this should be described in docstring or at least in a comment.
-
Why don't we clean cache and check if OS version has changed? Last 3 lines of original test...
custom_leapp_host.clean_cached_properties()
new_ver = str(custom_leapp_host.os_version)
assert new_ver == upgrade_path['target_version']
I tried to compare this new (non-admin) test with the original (admin) one and I see some differences...
- The original test uses flag reboot=True, but new one has reboot=False. And what is Channel flag for? I think this should be described in docstring or at least in a comment.
- Why don't we clean cache and check if OS version has changed? Last 3 lines of original test...
custom_leapp_host.clean_cached_properties() new_ver = str(custom_leapp_host.os_version) assert new_ver == upgrade_path['target_version']
@rmynar The difference between these 2 tests are that the first one uses api for the job which doesn't break the ssh connection post upgrade. With this test, I have used cli since the test module is under cli but the issue with this is ssh connection breaks post upgrade which causes error establishing connection after reboot, hence I set reboot to False and run the reboot in next step which doesn't break my ssh connection. The answer to your second question is we have introduced new option for remote execution in stream which is needed. We need to update the first test as well so it doesn't fail on stream as the parameter is mandatory.
trigger: test-robottelo pytest: tests/foreman/cli/test_leapp_client.py -k test_leapp_upgrade_rhel_non_admin
PRT Result
Build Number: 5969
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/cli/test_leapp_client.py -k test_leapp_upgrade_rhel_non_admin --external-logging
Test Result : ====== 1 failed, 1 deselected, 11 warnings, 1 error in 3073.03s (0:51:13) ======
trigger: test-robottelo pytest: tests/foreman/cli/test_leapp_client.py -k test_leapp_upgrade_rhel_non_admin
PRT Result
Build Number: 6045
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/cli/test_leapp_client.py -k test_leapp_upgrade_rhel_non_admin --external-logging
Test Result : ======= 1 failed, 1 deselected, 1 warning, 1 error in 2749.89s (0:45:49) =======
PRT Result
Build Number: 6048
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/cli/test_leapp_client.py -k test_leapp_upgrade_rhel_non_admin --external-logging
Test Result : ======= 1 failed, 1 deselected, 1 warning, 1 error in 3008.01s (0:50:08) =======
PRT Result
Build Number: 6069
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/cli/test_leapp_client.py -k test_leapp_upgrade_rhel_non_admin --external-logging
Test Result : ======= 1 failed, 1 deselected, 1 warning, 1 error in 2898.71s (0:48:18) =======
The test is currently failing because of the hammer bug: 24017. I am moving this PR to draft until the issue resolves.
trigger: test-robottelo pytest: tests/foreman/cli/test_leapp_client.py -k test_leapp_upgrade_rhel_non_admin
PRT Result
Build Number: 6303
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/cli/test_leapp_client.py -k test_leapp_upgrade_rhel_non_admin --external-logging
Test Result : ====== 1 failed, 1 deselected, 4 warnings, 1 error in 3125.90s (0:52:05) =======
trigger: test-robottelo pytest: tests/foreman/cli/test_leapp_client.py -k test_leapp_upgrade_rhel_non_admin
PRT Result
Build Number: 6341
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/cli/test_leapp_client.py -k test_leapp_upgrade_rhel_non_admin --external-logging
Test Result : ====== 1 failed, 1 deselected, 4 warnings, 1 error in 3074.88s (0:51:14) =======
trigger: test-robottelo pytest: tests/foreman/cli/test_leapp_client.py -k test_leapp_upgrade_rhel_non_admin env: ROBOTTELO_server__deploy_workflow: 'deploy-satellite' ROBOTTELO_server__deploy_arguments__deploy_rhel_version: '8' ROBOTTELO_server__deploy_arguments__deploy_sat_version: '6.15' ROBOTTELO_server__deploy_arguments__deploy_snap_version: 'ystream'
PRT Result
Build Number: 6345
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/cli/test_leapp_client.py -k test_leapp_upgrade_rhel_non_admin --external-logging
Test Result : ================= 1 deselected, 3 warnings, 1 error in 48.99s ==================
trigger: test-robottelo pytest: tests/foreman/cli/test_leapp_client.py -k test_leapp_upgrade_rhel_non_admin
trigger: test-robottelo pytest: tests/foreman/cli/test_leapp_client.py -k test_leapp_upgrade_rhel_non_admin