forked from analogdevicesinc/linux_image_ADI-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_fmcdaq3.sh
28 lines (24 loc) · 823 Bytes
/
test_fmcdaq3.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
# initialize scale to workaround dBFS GUI reload issue
/usr/local/bin/dds_set_scale.sh 0 >/dev/null
tmpdir=$(mktemp -d --tmpdir=/tmp fmcdaq3-test.XXXXXX)
pushd ${tmpdir} >/dev/null
/usr/local/bin/osc -p /usr/local/lib/osc/profiles/AD-FMCDAQ3_test.ini
rc=$?
popd >/dev/null
# save test output
serial="$(find /sys -name eeprom -size 256c | xargs fru-dump -b -i | awk '/^Serial Number/ {print $NF}')"
if [[ -n ${serial} ]]; then
# failing cards have log dirs named ${serial}-failed
[[ ${rc} -eq 0 ]] || serial+="-failed"
mkdir -p "/root/osc-logs/${serial}"
if [[ ! -d "/root/osc-logs/${serial}" ]]; then
mv ${tmpdir} "/root/osc-logs/${serial}"
else
# serial number collision
rand=$(basename ${tmpdir})
rand=${rand##*.}
mv ${tmpdir} "/root/osc-logs/${serial}.${rand}"
fi
fi
/sbin/shutdown -h now