forked from percona/orchestrator
-
Notifications
You must be signed in to change notification settings - Fork 0
CI: MySQL version matrix (5.7-9.6) and named channels tests #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
8436ee5
Add MySQL version matrix and named channels functional tests (#80, #81)
renecannao f2d2a0f
Fix CI: link named-channels.md in docs TOC, clean up test
renecannao fa42679
Fix stuck functional tests: add curl timeouts to all HTTP calls
renecannao 75fe695
Fix named channels test: use correct API endpoint, fix unbound $2
renecannao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,7 +13,7 @@ pass() { | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| fail() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo " ❌ FAIL: $1" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| [ -n "$2" ] && echo " $2" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| [ -n "${2:-}" ] && echo " $2" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ((FAIL_COUNT++)) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -33,7 +33,7 @@ summary() { | |||||||||||||||||||||||||||||||||||||||||||||||||||
| test_endpoint() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| local NAME="$1" URL="$2" EXPECT="$3" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| local CODE | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| CODE=$(curl -s -o /dev/null -w "%{http_code}" "$URL" 2>&1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| CODE=$(curl -s --max-time 10 -o /dev/null -w "%{http_code}" "$URL" 2>&1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ "$CODE" = "$EXPECT" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| pass "$NAME (HTTP $CODE)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -45,7 +45,7 @@ test_endpoint() { | |||||||||||||||||||||||||||||||||||||||||||||||||||
| test_body_contains() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| local NAME="$1" URL="$2" EXPECT="$3" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| local BODY | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| BODY=$(curl -s "$URL" 2>&1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| BODY=$(curl -s --max-time 10 "$URL" 2>&1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| if echo "$BODY" | grep -q "$EXPECT"; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| pass "$NAME" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -57,7 +57,7 @@ test_body_contains() { | |||||||||||||||||||||||||||||||||||||||||||||||||||
| wait_for_orchestrator() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Waiting for orchestrator to be ready..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| for i in $(seq 1 30); do | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| if curl -s -o /dev/null "$ORC_URL/api/clusters" 2>/dev/null; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| if curl -s --max-time 5 -o /dev/null "$ORC_URL/api/clusters" 2>/dev/null; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Orchestrator ready after ${i}s" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| return 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -73,35 +73,92 @@ CLUSTER_NAME="" | |||||||||||||||||||||||||||||||||||||||||||||||||||
| discover_topology() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| local MASTER_HOST="$1" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Seeding discovery with $MASTER_HOST..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| curl -s "$ORC_URL/api/discover/$MASTER_HOST/3306" > /dev/null | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| curl -s --max-time 10 "$ORC_URL/api/discover/$MASTER_HOST/3306" > /dev/null | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Also seed replicas directly | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| curl -s "$ORC_URL/api/discover/mysql2/3306" > /dev/null 2>&1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| curl -s "$ORC_URL/api/discover/mysql3/3306" > /dev/null 2>&1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| curl -s --max-time 10 "$ORC_URL/api/discover/mysql2/3306" > /dev/null 2>&1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| curl -s --max-time 10 "$ORC_URL/api/discover/mysql3/3306" > /dev/null 2>&1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Waiting for topology discovery..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| for i in $(seq 1 60); do | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Get the cluster name dynamically | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| CLUSTER_NAME=$(curl -s "$ORC_URL/api/clusters" 2>/dev/null | python3 -c "import json,sys; c=json.load(sys.stdin); print(c[0] if c else '')" 2>/dev/null || echo "") | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| CLUSTER_NAME=$(curl -s --max-time 5 "$ORC_URL/api/clusters" 2>/dev/null | python3 -c "import json,sys; c=json.load(sys.stdin); print(c[0] if c else '')" 2>/dev/null || echo "") | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ -n "$CLUSTER_NAME" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| local COUNT | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| COUNT=$(curl -s "$ORC_URL/api/cluster/$CLUSTER_NAME" 2>/dev/null | python3 -c "import json,sys; print(len(json.load(sys.stdin)))" 2>/dev/null || echo "0") | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| COUNT=$(curl -s --max-time 5 "$ORC_URL/api/cluster/$CLUSTER_NAME" 2>/dev/null | python3 -c "import json,sys; print(len(json.load(sys.stdin)))" 2>/dev/null || echo "0") | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ "$COUNT" -ge 3 ] 2>/dev/null; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Full topology discovered (${COUNT} instances, cluster=$CLUSTER_NAME) after ${i}s" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| return 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Re-seed replicas periodically | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ "$((i % 10))" = "0" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| curl -s "$ORC_URL/api/discover/mysql2/3306" > /dev/null 2>&1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| curl -s "$ORC_URL/api/discover/mysql3/3306" > /dev/null 2>&1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| curl -s --max-time 10 "$ORC_URL/api/discover/mysql2/3306" > /dev/null 2>&1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| curl -s --max-time 10 "$ORC_URL/api/discover/mysql3/3306" > /dev/null 2>&1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| sleep 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "WARNING: Cluster=$CLUSTER_NAME, instances=${COUNT:-0} after 60s" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| return 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Detect MySQL major version (e.g., "5.7", "8.0", "8.4", "9.0") | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Caches result in MYSQL_MAJOR_VERSION | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| MYSQL_MAJOR_VERSION="" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| mysql_version() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ -n "$MYSQL_MAJOR_VERSION" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "$MYSQL_MAJOR_VERSION" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| return | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| local FULL | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| FULL=$(docker compose -f tests/functional/docker-compose.yml exec -T mysql1 \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| mysql -uroot -ptestpass -Nse "SELECT VERSION()" 2>/dev/null | tr -d '[:space:]') | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| MYSQL_MAJOR_VERSION=$(echo "$FULL" | sed -E 's/^([0-9]+\.[0-9]+).*/\1/') | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "$MYSQL_MAJOR_VERSION" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Check if MySQL version is 5.7 (returns 0 for 5.7, 1 otherwise) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| mysql_is_57() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| [ "$(mysql_version)" = "5.7" ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Return the correct CHANGE REPLICATION SOURCE / CHANGE MASTER command | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Arguments: HOST PORT USER PASSWORD | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| mysql_change_source_sql() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| local HOST="$1" PORT="$2" USER="$3" PASS="$4" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| if mysql_is_57; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "CHANGE MASTER TO MASTER_HOST='${HOST}', MASTER_PORT=${PORT}, MASTER_USER='${USER}', MASTER_PASSWORD='${PASS}', MASTER_AUTO_POSITION=1;" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "CHANGE REPLICATION SOURCE TO SOURCE_HOST='${HOST}', SOURCE_PORT=${PORT}, SOURCE_USER='${USER}', SOURCE_PASSWORD='${PASS}', SOURCE_AUTO_POSITION=1, GET_SOURCE_PUBLIC_KEY=1;" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Return the correct CHANGE REPLICATION SOURCE / CHANGE MASTER command with FOR CHANNEL | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Arguments: HOST PORT USER PASSWORD CHANNEL | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| mysql_change_source_channel_sql() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| local HOST="$1" PORT="$2" USER="$3" PASS="$4" CHANNEL="$5" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| if mysql_is_57; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "CHANGE MASTER TO MASTER_HOST='${HOST}', MASTER_PORT=${PORT}, MASTER_USER='${USER}', MASTER_PASSWORD='${PASS}', MASTER_AUTO_POSITION=1 FOR CHANNEL '${CHANNEL}';" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "CHANGE REPLICATION SOURCE TO SOURCE_HOST='${HOST}', SOURCE_PORT=${PORT}, SOURCE_USER='${USER}', SOURCE_PASSWORD='${PASS}', SOURCE_AUTO_POSITION=1, GET_SOURCE_PUBLIC_KEY=1 FOR CHANNEL '${CHANNEL}';" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Return the correct START REPLICA / START SLAVE command | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| mysql_start_replica_sql() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| if mysql_is_57; then echo "START SLAVE;"; else echo "START REPLICA;"; fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Return the correct STOP REPLICA / STOP SLAVE command | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| mysql_stop_replica_sql() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| if mysql_is_57; then echo "STOP SLAVE;"; else echo "STOP REPLICA;"; fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Return the correct RESET REPLICA ALL / RESET SLAVE ALL command | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| mysql_reset_replica_all_sql() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| if mysql_is_57; then echo "RESET SLAVE ALL;"; else echo "RESET REPLICA ALL;"; fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Get ProxySQL servers for a hostgroup | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| proxysql_servers() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| local HG="$1" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -120,6 +177,11 @@ mysql_read_only() { | |||||||||||||||||||||||||||||||||||||||||||||||||||
| # Get MySQL replication source | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| mysql_source_host() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| local CONTAINER="$1" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| docker compose -f tests/functional/docker-compose.yml exec -T "$CONTAINER" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| mysql -uroot -ptestpass -Nse "SHOW REPLICA STATUS\G" 2>/dev/null | grep "Source_Host" | awk '{print $2}' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| if mysql_is_57; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| docker compose -f tests/functional/docker-compose.yml exec -T "$CONTAINER" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| mysql -uroot -ptestpass -Nse "SHOW SLAVE STATUS\G" 2>/dev/null | grep "Master_Host" | awk '{print $2}' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| docker compose -f tests/functional/docker-compose.yml exec -T "$CONTAINER" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| mysql -uroot -ptestpass -Nse "SHOW REPLICA STATUS\G" 2>/dev/null | grep "Source_Host" | awk '{print $2}' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
178
to
187
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mysql_source_host()still assumes single-source replication.On a multi-channel replica,
SHOW SLAVE/REPLICA STATUS\Greturns one block per channel. This helper will therefore emit everyMaster_Host/Source_Hostit finds, so callers get a concatenated value as soon asmysql3has both its default channel andextra. Please make this helper channel-aware, or fail fast when multiple channels are present.🐛 Proposed fix
mysql_source_host() { - local CONTAINER="$1" + local CONTAINER="$1" CHANNEL="${2:-}" if mysql_is_57; then + local STATUS_SQL="SHOW SLAVE STATUS\\G" + [ -n "$CHANNEL" ] && STATUS_SQL="SHOW SLAVE STATUS FOR CHANNEL '${CHANNEL}'\\G" docker compose -f tests/functional/docker-compose.yml exec -T "$CONTAINER" \ - mysql -uroot -ptestpass -Nse "SHOW SLAVE STATUS\G" 2>/dev/null | grep "Master_Host" | awk '{print $2}' + mysql -uroot -ptestpass -Nse "$STATUS_SQL" 2>/dev/null | + awk -F': ' '$1 == "Master_Host" { print $2; exit }' else + local STATUS_SQL="SHOW REPLICA STATUS\\G" + [ -n "$CHANNEL" ] && STATUS_SQL="SHOW REPLICA STATUS FOR CHANNEL '${CHANNEL}'\\G" docker compose -f tests/functional/docker-compose.yml exec -T "$CONTAINER" \ - mysql -uroot -ptestpass -Nse "SHOW REPLICA STATUS\G" 2>/dev/null | grep "Source_Host" | awk '{print $2}' + mysql -uroot -ptestpass -Nse "$STATUS_SQL" 2>/dev/null | + awk -F': ' '$1 == "Source_Host" { print $2; exit }' fi }🤖 Prompt for AI Agents