-
Notifications
You must be signed in to change notification settings - Fork 400
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[desktop-lite] - add tests for running xtigervnc and novnc (#1090)
* [desktop-lite] - add tests for running xtigervnc and novnc * change for error while running test scenario * changed test * Update devcontainer-feature.json --------- Co-authored-by: Samruddhi Khandale <samruddhikhandale@github.com>
- Loading branch information
1 parent
28ca71a
commit 5cb0d2d
Showing
4 changed files
with
46 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"test_xtigervnc_novnc_started": { | ||
"image": "ubuntu:noble", | ||
"features": { | ||
"desktop-lite": {} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Optional: Import test library | ||
source dev-container-features-test-lib | ||
|
||
# Check if xtigervnc & noVnc processes are running after successful installation and initialization | ||
check_process_running() { | ||
port=$1 | ||
# Get process id of process running on specific port | ||
PID=$(lsof -i :$port | awk 'NR==2 {print $2}') | ||
if [ -n "$PID" ]; then | ||
CMD=$(ps -p $PID -o cmd --no-headers) | ||
GREEN='\033[0;32m'; NC='\033[0m'; RED='\033[0;31m'; YELLOW='\033[0;33m'; | ||
echo -e "${GREEN}Command running on port $port: ${YELLOW}$CMD${NC}" | ||
else | ||
echo -e "${RED}No process found listening on port $port.${NC}" | ||
fi | ||
} | ||
|
||
check "Whether xtigervnc is Running" check_process_running 5901 | ||
sleep 1 | ||
check "Whether no_vnc is Running" check_process_running 6080 | ||
|
||
check "desktop-init-exists" bash -c "ls /usr/local/share/desktop-init.sh" | ||
check "log-exists" bash -c "ls /tmp/container-init.log" | ||
check "log file contents" bash -c "cat /tmp/container-init.log" | ||
|
||
# Report result | ||
reportResults |