Skip to content

Commit

Permalink
Update IS_ONLINE when trying socket connection [Agent Persist Firewal…
Browse files Browse the repository at this point in the history
…l test] (#3247)

* Update IS_ONLINE when trying socket connection [Agent Persist Firewall test]

---------

Co-authored-by: narrieta@microsoft <narrieta>
  • Loading branch information
narrieta authored Oct 21, 2024
1 parent e5e2df3 commit cd1a957
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ function ping_localhost

function socket_connection
{
output=$(python3 /home/"$TEST_USER"/bin/agent_persist_firewall-check_connectivity.py 2>&1)
echo $output
python3 /home/"$TEST_USER"/bin/agent_persist_firewall-check_connectivity.py 2>&1 && echo 0 || echo 1
}

# Check more, sleep less
Expand Down Expand Up @@ -77,7 +76,7 @@ if [ "$IS_ONLINE" -eq 1 ]; then
echo "Ping to localhost succeeded"
fi
echo "Running socket connection to wireserver:53 option"
socket_connection
IS_ONLINE=$(socket_connection)
fi
if [ "$IS_ONLINE" -eq 1 ]; then
# We will never be able to get online. Kill script.
Expand All @@ -91,7 +90,7 @@ echo "Trying to contact Wireserver as $USER to see if accessible"

echo ""
echo "Firewall configuration before accessing Wireserver:"
if command -v iptables; then
if sudo which iptables > /dev/null ; then
sudo iptables -t security -L -nxv -w
else
sudo nft list table walinuxagent
Expand Down

0 comments on commit cd1a957

Please sign in to comment.