-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7e6f45e
commit e8fd871
Showing
21 changed files
with
401 additions
and
78 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +0,0 @@ | ||
etc/init.d/S11bmc-otg | ||
etc/init.d/S50sshd | ||
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
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
14 changes: 0 additions & 14 deletions
14
tp2bmc/board/tp2bmc/factory_overlay/upper/factory/005-node1_and_4_peripheral_test.sh
This file was deleted.
Oops, something went wrong.
85 changes: 85 additions & 0 deletions
85
tp2bmc/board/tp2bmc/factory_overlay/upper/factory/005-node_ethernet_test.sh
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,85 @@ | ||
#!/bin/bash | ||
|
||
source helpers.sh | ||
source config.sh | ||
|
||
|
||
retrieve_ip_from_uart() { | ||
local n="$1" | ||
local tty="/dev/ttyS${n}" | ||
|
||
USERNAME="$RK1_USERNAME" | ||
PASSWORD="$RK1_PASSWORD" | ||
|
||
# login | ||
sleep 2 | ||
echo "${USERNAME}" > "${tty}" | ||
sleep 1 | ||
echo "${PASSWORD}" > "${tty}" | ||
sleep 3 | ||
print_ipv4="ip -4 addr show | grep -oP '(?<=inet\\s)\\d+(\\.\\d+){3}'" | ||
echo "$print_ipv4" > "/dev/ttyS${n}" | ||
sleep 1 | ||
return_line=$(tpi uart --node "${n}" get | tail -n 2 | head -n 1) | ||
echo "$return_line" | grep -oE '([0-9]{1,3}\.){3}[0-9]{1,3}' | ||
} | ||
|
||
get_ip_and_ping() { | ||
local n="$1" | ||
local ip | ||
|
||
wait_until_booted $n | ||
if [[ $? -ne 0 ]]; then | ||
echo "$(uart_output_node "$n")" | ||
echo "Error: Timeout occurred waiting for node ${n} to boot" | ||
exit 1 | ||
fi | ||
|
||
local node_ip_var="NODE${n}_IP" | ||
local node_ip_value=$(eval echo \$$node_ip_var) | ||
|
||
if [ -z "$node_ip_value" ]; then | ||
echo -e "\tnode ${n}: getting ip from uart" | ||
ip=$(retrieve_ip_from_uart "$n") | ||
else | ||
ip="$node_ip_value" | ||
fi | ||
|
||
# Ping the IP address | ||
ping -c 4 "$ip" > /dev/null | ||
if [ "$?" -ne 0 ]; then | ||
echo "$(uart_output_node "$n")" | ||
echo "Error: could not ping node $n" | ||
exit 1 | ||
fi | ||
|
||
echo -e "\tNode $n $ip => OK" | ||
} | ||
|
||
node1_test() { | ||
get_ip_and_ping "1" | ||
} | ||
|
||
node2_test() { | ||
get_ip_and_ping "2" | ||
} | ||
|
||
node3_test() { | ||
get_ip_and_ping "3" | ||
} | ||
|
||
node4_test() { | ||
get_ip_and_ping "4" | ||
} | ||
|
||
tpi power off > /dev/null | ||
tpi power on > /dev/null | ||
|
||
echo -e "\tWaiting for modules to boot, this can take up to a minute.." | ||
sleep 15 | ||
|
||
node1_test | ||
node2_test | ||
node3_test | ||
node4_test | ||
|
9 changes: 0 additions & 9 deletions
9
tp2bmc/board/tp2bmc/factory_overlay/upper/factory/006-node_ethernet_test.sh
This file was deleted.
Oops, something went wrong.
91 changes: 91 additions & 0 deletions
91
tp2bmc/board/tp2bmc/factory_overlay/upper/factory/006-node_peripheral_test.sh
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,91 @@ | ||
#!/bin/bash | ||
|
||
source helpers.sh | ||
BMC_OTG="08DE:1234" | ||
RK1_USB="2207:350b" | ||
|
||
assert_pci_devices() { | ||
local devices=$(get_pci_devices "$1" | grep -v '^$') | ||
local count="$2" | ||
line_count=$(echo "$devices" | wc -l) | ||
# Exit with an error if there are fewer than 2 lines | ||
if [ "$line_count" -lt "${count}" ]; then | ||
echo "Error: Fewer than ${count} (got ${line_count}) PCI devices connected " | ||
echo -e "\tFound:" | ||
echo -e "\t${devices}" | ||
echo "Error: Node ${n}: could not detect NVMe or MPCIE device" | ||
exit 1 | ||
fi | ||
|
||
} | ||
|
||
print_usb_names() { | ||
local usb_devices="$1" | ||
# Loop through each line and print the name of the USB device | ||
echo "$usb_devices" | while IFS= read -r line; do | ||
# Extract and print the device name (fields starting from 7th position) | ||
local dev=$(echo "$line" | awk '{for(i=7;i<=NF;i++) printf $i" "; print ""}') | ||
echo -e "\t\t${dev}" | ||
done | ||
} | ||
|
||
usb_dev_test() { | ||
tpi advanced msd --node 4 >/dev/null | ||
tpi usb device --node 4 > /dev/null | ||
confirm "plug the USB cable from 'BMC_USB_OTG' to the 'USB_DEV' port" | ||
devices=$(get_usb_devices "1") | ||
if echo "$devices" | grep -q "ID ${RK1_USB}"; then | ||
echo -e "\tUSB_DEV => OK" | ||
else | ||
echo "$devices" | ||
echo "Error: Could not detect 'USB_DEV' port" | ||
exit 1 | ||
fi | ||
} | ||
|
||
node1_tests() { | ||
result=$(send_command "1" "lsusb -d ${BMC_OTG}") | ||
if [[ $? -ne 0 ]]; then | ||
echo "$result" | ||
echo "Error: NODE1_USB_HOST or BMC_USB_OTG port not responding" | ||
exit 1 | ||
fi | ||
confirm "Do you see video output on the HDMI port?" | ||
confirm "Do you see video output on the DSI port?" | ||
assert_pci_devices "1" "2" | ||
echo -e "\tNODE1 => OK" | ||
} | ||
|
||
node2_tests() { | ||
assert_pci_devices "2" "2" | ||
echo -e "\tNODE2 => OK" | ||
} | ||
|
||
node3_tests() { | ||
assert_pci_devices "3" "1" | ||
echo -e "\tNODE3 => OK" | ||
} | ||
|
||
node4_tests() { | ||
usb_devices=$(get_usb_devices 4) | ||
line_count=$(echo "$usb_devices" | wc -l) | ||
# Exit with an error if there are fewer than 2 lines | ||
if [ "$line_count" -lt 4 ]; then | ||
echo "Error: Fewer than 4(${line_count}) USB devices connected to NODE4" | ||
echo "got: ${usb_devices}" | ||
exit 1 | ||
fi | ||
|
||
echo -e "\tUSB3X2 NODE4" | ||
print_usb_names "$usb_devices" | ||
echo -e "\tUSB3X2 NODE4 => OK" | ||
assert_pci_devices "4" "1" | ||
echo -e "\tNODE4 => OK" | ||
|
||
} | ||
|
||
#node1_tests | ||
#node2_tests | ||
#node3_tests | ||
#node4_tests | ||
usb_dev_test |
5 changes: 5 additions & 0 deletions
5
tp2bmc/board/tp2bmc/factory_overlay/upper/factory/007-fan-test.sh
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,5 @@ | ||
#!/bin/bash | ||
source helpers.sh | ||
|
||
confirm "Is the fan working?" | ||
confirm "Switch the 'FAN VOL SWITCH'. Is the speed changing?" |
6 changes: 6 additions & 0 deletions
6
tp2bmc/board/tp2bmc/factory_overlay/upper/factory/008-key1_test.sh
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,6 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
source helpers.sh | ||
tpi power on > /dev/null | ||
question "Press 'Key1'. Do the red light go off?" |
15 changes: 15 additions & 0 deletions
15
tp2bmc/board/tp2bmc/factory_overlay/upper/factory/config.sh
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,15 @@ | ||
#!/bin/bash | ||
|
||
ASSERT_VERSION=4111 | ||
ASSERT_MODEL_NAME="Turing Pi 2 (v2.5.1)" | ||
|
||
# the amount allowed to wait for a module to boot (in secs) | ||
WAITING_TIMEOUT=60 | ||
RK1_USERNAME=ubuntu | ||
RK1_PASSWORD=Turingpi123 | ||
FINGERPRINT="ubuntu login:" | ||
|
||
NODE1_IP="" | ||
NODE2_IP="" | ||
NODE3_IP="" | ||
NODE4_IP="" |
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
Oops, something went wrong.