Skip to content

Commit

Permalink
Factory testing updates
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-kukiela committed Aug 16, 2024
1 parent 930f6ea commit df400d8
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 11 deletions.
16 changes: 16 additions & 0 deletions tp2bmc/board/tp2bmc/factory_overlay/upper/etc/network/interfaces
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# interface file auto-generated by buildroot

auto lo
iface lo inet loopback

auto br0
iface br0 inet dhcp
bridge-ports node1 node2 node3 node4 ge0 ge1
pre-up /etc/network/nfs_check
wait-delay 15
hostname $(hostname)

auto br0:1
iface br0:1 inet static
address 192.168.0.2
netmask 255.255.0.0
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash
source config.sh

# Extract the gateway address for the eth0 interface
gateway=$(ip route show dev eth0 | grep default | awk '{print $3}')
ip=$(ip -o -4 addr show eth0 | awk '{print $4}' | cut -d/ -f1)
# Extract the gateway address for the br0 interface
gateway=$(ip route show dev br0 | grep default | awk '{print $3}')
ip=$(ip -o -4 addr show br0 | awk '{print $4}' | cut -d/ -f1)

if [ "$ip" == "$NODE1_IP" ] || [ "$ip" == "$NODE2_IP" ] || \
[ "$ip" == "$NODE3_IP" ] || [ "$ip" == "$NODE4_IP" ]; then
Expand All @@ -13,12 +13,12 @@ fi

# Check if the gateway was found
if [ -z "$gateway" ]; then
echo "No gateway found for eth0"
echo "No gateway found for br0"
exit 1
fi

mac=$(ifconfig eth0 | grep HWaddr | awk '{print $5}')
echo -e "\tinterface:\t'eth0'"
mac=$(ifconfig br0 | grep HWaddr | awk '{print $5}')
echo -e "\tinterface:\t'br0'"
echo -e "\tMAC: \t\t'${mac}'"

ping -c 4 "${gateway}" > /dev/null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ source node_helpers.sh

tpi advanced msd --node 2 >/dev/null
tpi usb device --node 2 > /dev/null
sleep 1
devices=$(get_usb_devices "1")
if echo "$devices" | grep -q "ID ${RK1_USB}"; then
echo -e "\tUSB_DEV => OK"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ NODE4_IP="192.168.0.104"
ASSERT_VERSION=4211
ASSERT_MODEL_NAME="Turing Pi 2 (v2.5.1)"

TPI_MAC_BASE="C4FF841"
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ get_sata_devices() {

get_pci_devices() {
local n="$1"
send_command "$n" "lspci | grep -v ASM1061 | grep -v RK3588 | grep -v 'PCI bridge: Broadcom Inc'"
send_command "$n" "lspci | grep -v ASM1061 | grep -v RK3588 | grep -v 'PCI bridge: Broadcom Inc' | grep -v 'Technologies, Inc. VL805/806 xHCI USB 3.0 Controller (rev 01)'"
}

assert_pci_devices() {
Expand All @@ -37,7 +37,7 @@ assert_pci_devices() {
print_pci_names "$devices"
fi

if [ "$line_count" != "${count}" ]; then
if [ $line_count -ne ${count} ]; then
echo "Error: The test requires ${count} PCI device(s) connected to node $node, found $line_count." >&2
echo "Error: Verify the connected NVMe or MPCIe modules" >&2
exit 1
Expand All @@ -56,7 +56,7 @@ assert_usb_devices() {
print_usb_names "$usb_devices"
fi

if [[ "$line_count" == "$usb_count" ]]; then
if [[ $line_count -ne $usb_count ]]; then
echo "Error: the test requires ${usb_count} USB device(s) connected to node ${node}, found ${line_count}" >&2
exit 1
fi
Expand All @@ -74,7 +74,7 @@ assert_sata_devices() {
print_sata_drives "$devices"
fi

if [[ "$line_count" == "$count" ]]; then
if [[ $line_count -ne $count ]]; then
echo "Error: the test requires ${count} SATA device(s) connected to node ${node}, found ${line_count}" >&2
exit 1
fi
Expand Down

0 comments on commit df400d8

Please sign in to comment.