Skip to content

Commit 4db959d

Browse files
committed
Update IP address handling in workflow
1 parent 8f02173 commit 4db959d

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

.github/workflows/usb-wireless-autotest.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,11 @@ jobs:
109109
shell: bash
110110
run: |
111111
112+
ip_addr=$(echo "${{ matrix.json.device_ip }}" | sed 's#/.*##')
112113
DEVICE=$(echo "wlx${{ matrix.json.serial }}" | sed "s/://g")
113114
while true; do
114-
#CONNECTION=$(ssh ci@100.113.54.60 "nmcli -t -f NAME connection show --active | grep ${DEVICE} || true")
115-
CONNECTION=$(ssh ci@100.113.54.60 "networkctl | grep ${DEVICE} | grep routable || true")
115+
#CONNECTION=$(ssh ci@${ip_addr} "nmcli -t -f NAME connection show --active | grep ${DEVICE} || true")
116+
CONNECTION=$(ssh ci@${ip_addr} "networkctl | grep ${DEVICE} | grep routable || true")
116117
if [[ -n "${CONNECTION}" ]]; then
117118
break
118119
fi
@@ -123,24 +124,26 @@ jobs:
123124
shell: bash
124125
run: |
125126
127+
ip_addr=$(echo "${{ matrix.json.device_ip }}" | sed 's#/.*##')
126128
DEVICE=$(echo "wlx${{ matrix.json.serial }}" | sed "s/://g")
127129
echo "DEVICE=$DEVICE" >> $GITHUB_ENV
128130
rm -rf test; mkdir -p test
129-
numbers=$(ssh ci@100.113.54.60 "iperf3 -R -c 10.0.60.10 -B 10.0.50.50 -t 5 -J | jq '.intervals[] .sum .bits_per_second' | LC_ALL=C datamash median 1 | cut -d"-" -f2")
131+
numbers=$(ssh ci@${ip_addr} "iperf3 -R -c 10.0.60.10 -B 10.0.50.50 -t 5 -J | jq '.intervals[] .sum .bits_per_second' | LC_ALL=C datamash median 1 | cut -d"-" -f2")
130132
mbits=$(echo $numbers | LC_ALL=C awk '{$1/=1048576;printf "%.0f Mbps\n",$1}')
131133
echo "|${{ matrix.json.name }}|${{ matrix.json.device_type }}| ${{ matrix.json.serial }} | ${{ matrix.json.device_class }} | ${mbits} |" > test/${DEVICE}.iperf
132134
133135
# get Armbian version and kernel
134-
echo "$(ssh ci@100.113.54.60 "cat /etc/armbian-release | grep VERSION")" > test/${DEVICE}.system
135-
echo "$(ssh ci@100.113.54.60 "cat /etc/armbian-release | grep ^ARCH")" > test/${DEVICE}.system
136-
echo "KERNEL=$(ssh ci@100.113.54.60 "uname -r")" >> test/${DEVICE}.system
136+
echo "$(ssh ci@${ip_addr} "cat /etc/armbian-release | grep VERSION")" > test/${DEVICE}.system
137+
echo "$(ssh ci@${ip_addr} "cat /etc/armbian-release | grep ^ARCH")" > test/${DEVICE}.system
138+
echo "KERNEL=$(ssh ci@${ip_addr} "uname -r")" >> test/${DEVICE}.system
137139
138140
- name: "Remove adapter"
139141
shell: bash
140142
run: |
141143
142-
ssh [email protected] "sudo rm /etc/netplan/wireless.yaml"
143-
ssh [email protected] "sudo netplan apply"
144+
ip_addr=$(echo "${{ matrix.json.device_ip }}" | sed 's#/.*##')
145+
ssh ci@${ip_addr} "sudo rm /etc/netplan/wireless.yaml"
146+
ssh ci@${ip_addr} "sudo netplan apply"
144147
145148
- name: "Upload test summary"
146149
uses: actions/upload-artifact@v4
@@ -186,8 +189,8 @@ jobs:
186189
echo "|Name|Chip|MAC|Class|Average Iperf|" >> $GITHUB_STEP_SUMMARY
187190
echo "|:---|:---|:---|:---|---:|" >> $GITHUB_STEP_SUMMARY
188191
cat test/*.iperf | sed '$ s/.$//' >> $GITHUB_STEP_SUMMARY
189-
echo "### System logs" >> $GITHUB_STEP_SUMMARY
190-
echo "$(ssh [email protected] "sudo dmesg")" >> $GITHUB_STEP_SUMMARY
192+
#echo "### System logs" >> $GITHUB_STEP_SUMMARY
193+
#echo "$(ssh [email protected] "sudo dmesg")" >> $GITHUB_STEP_SUMMARY
191194
192195
- uses: geekyeggo/delete-artifact@v5
193196
with:

0 commit comments

Comments
 (0)