Skip to content

Commit 437d865

Browse files
authored
NO-ISSUE: Take screenshot after each console key press (#1768)
* Take screenshot after each console key press Add additional screenshots to help with debugging issues with console interaction in CI tests. * Add 3s sleep after ESC from network tree view The bad_dns tests appears to fail when the Tab key press to move to the <Quit> button is not being registered. At the end of the test Enter key is pressed but instead of quiting agent-tui, it enters nmtui because the cursor is still on the <Configure Network> button. Adding a 3s sleep after escaping from the the network tree view should give it more time to properly exit and return to agent-tui. * Add an additional ESC key press after exiting nmtui There appears to be a blank screen in some environments that that appears after exiting nmtui. The ESC key then exits out of this blank screen and into the network tree view. Adding an extra ESC key press to fully exit out of nmtui and tree view. In environments where the blank screen does not appear, the extra ESC key press is innocuous. * Quit agent-tui using the q key Navigating to the <Quit> button using TAB or LEFT sometimes does not register when sent through "virsh send-key" in the CI. openshift/agent-installer-utils#107 introduced an alternative way to exit agent-tui from the checks page.
1 parent 3f66edd commit 437d865

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

agent/e2e/agent-tui/test-fix-wrong-dns.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ fi
6363
pressDown "Select Quit" ${numStepsToQuit}
6464

6565
pressEnter "Select 'Quit' menu item"
66-
pressEsc "Esc from network tree view"
67-
pressTab "Goto <Quit> button to exit agent-tui" 1
66+
pressEsc "Esc from network tree view" 2
67+
sleep 3
6868

6969
# wait for check to update, to visually see the release image
7070
# check change to passing.
7171
sleep 10
72-
pressEnter "Exit agent-tui"
72+
pressKeys "Exit agent-tui" "qq"

agent/e2e/agent-tui/utils.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ function _pressKey() {
1414
fi
1515
sudo virsh send-key $node_name $keyCode
1616

17+
timestamp=$(date +"%Y-%m-%d--%H:%M:%S")
18+
sudo virsh screenshot $node_name "${OCP_DIR}/${timestamp}-${node_name}_after_${keyCode}.ppm"
19+
1720
# On some CI instances, the sequence of events appears to be too fast
1821
# for the console refresh, leading the test in the wrong state.
1922
# Let's add a small pause between one keypress event and the subsequent
@@ -44,7 +47,7 @@ function pressEnter() {
4447

4548
function pressTab() {
4649
pressKey "$1" KEY_TAB "$2"
47-
}
50+
}
4851

4952
function pressDown() {
5053
pressKey "$1" KEY_DOWN "$2" "$3"
@@ -54,7 +57,6 @@ function pressBackspace() {
5457
pressKey "$1" KEY_BACKSPACE "$2"
5558
}
5659

57-
5860
function pressEsc() {
5961
pressKey "$1" KEY_ESC "$2"
6062
}

0 commit comments

Comments
 (0)