-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reorganize FMCDAQ3, ADRV9361_BOB, SYNCHRONA #20
base: reorganize_tests
Are you sure you want to change the base?
Changes from 13 commits
01feda1
4a0aa5e
e384d1d
3a18ff3
053ae25
fface59
04e3616
265988f
bde6a55
c6f8e9b
5ac6621
6b85b0e
e727d04
def3e61
52f568e
1536970
9f88cbf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
SCRIPT_DIR="$(readlink -f $(dirname $0))" | ||
source "$SCRIPT_DIR/../lib/utils.sh" | ||
|
||
MODE="$1" | ||
case $MODE in | ||
"FMCDAQ3 Test") | ||
"$SCRIPT_DIR/rf_test.sh"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why the quotation marks? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added the quotes to allow for spaces in the file path. Not absolutely necessary for the prodtest images - this is likely a harmless leftover from one of my test runs. Should I remove it the quotes consistency's sake? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
TEST_RESULT=$? | ||
if [ $TEST_RESULT -ne 0 ]; then | ||
handle_error_state "$BOARD_SERIAL" | ||
exit 1; | ||
fi | ||
;; | ||
|
||
*) echo "Invalid option $MODE" ;; | ||
esac | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
SCRIPT_DIR="$(readlink -f $(dirname $0))" | ||
|
||
echo | ||
python3 -m pytest --color yes -vs $SCRIPT_DIR/../work/pyadi-iio/test/test_daq3_prod.py --uri="ip:analog.local" --adi-hw-map --hw=daq3 --snumber="$BOARD_SERIAL" | ||
ANSWER=$? | ||
exit $ANSWER | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
# Wrapper script for doing a production cycle/routine for fmcdaq3. | ||
# This script handles | ||
# | ||
# Can be called with: ./production_FMCDAQ3.sh | ||
# | ||
|
||
SCRIPT_DIR="$(readlink -f $(dirname $0))" | ||
|
||
source $SCRIPT_DIR/lib/production.sh | ||
source $SCRIPT_DIR/lib/utils.sh | ||
|
||
while true; do | ||
echo_blue "Please enter your choice: " | ||
options=("FMCDAQ3 Test" "Power-Off Carrier" "Power-Off Pi") | ||
select opt in "${options[@]}"; do | ||
case $REPLY in | ||
1) | ||
wait_for_board_online | ||
export BOARD_SERIAL=$(get_board_serial) | ||
echo_blue "Starting FMCDAQ3 Test" | ||
production "crr" "$opt" "FMCDAQ3" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's outside the scope of this pull request, but for future reference I think the "crr"/target parameter is redundant, i think only talise uses it for something minor. Perhaps it should be removed in future versions |
||
break ;; | ||
2) | ||
wait_for_board_online | ||
ssh_cmd "sudo poweroff &>/dev/null" | ||
break ;; | ||
3) | ||
enforce_root | ||
poweroff | ||
break ;; | ||
|
||
*) echo "invalid option $REPLY";; | ||
esac | ||
done | ||
done | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,26 +31,61 @@ setup_apt_install_prereqs() { | |
sudo_required | ||
sudo -s <<-EOF | ||
apt-get -y update | ||
apt-get -y install bc sshpass libfftw3-dev librsvg2-dev libgtk-3-dev \ | ||
apt-get -y -o DPkg::Lock::Timeout=60 install \ | ||
bc sshpass libfftw3-dev librsvg2-dev libgtk-3-dev \ | ||
cmake build-essential git libxml2 libxml2-dev bison flex \ | ||
expect usbutils dfu-util screen libaio-dev libglib2.0-dev picocom \ | ||
wget unzip curl cups cups-bsd intltool itstool libxml2-utils \ | ||
libusb-dev libusb-1.0-0-dev htpdate xfce4-terminal libiec16022-dev \ | ||
openssh-server gpg dnsmasq libcurl4-gnutls-dev libqrencode-dev pv \ | ||
python3-pytest python3-libiio python3-scapy python3-scipy | ||
python3-pytest python3-libiio python3-scapy python3-scipy libzstd-dev \ | ||
python3.7 python3-pip | ||
/etc/init.d/htpdate restart | ||
EOF | ||
} | ||
|
||
__common_build_tool() { | ||
local c_files | ||
mkdir -p work | ||
setup_pip_install_prereqs() { | ||
sudo_required | ||
sudo -s <<-EOF | ||
pip install --upgrade pip setuptools | ||
EOF | ||
} | ||
|
||
for c_file in $tool_c ; do | ||
cp -f "src/$c_file" "work/$c_file" | ||
c_files="$c_files work/$c_file" | ||
done | ||
gcc $c_files -o "work/$tool" $cflags $ldflags | ||
download_to() { | ||
local url="$1" | ||
local file="$2" | ||
|
||
wget "$url" -O "$file" || { | ||
echo_red "Download has failed..." | ||
rm -f "$file" | ||
return 1 | ||
} | ||
|
||
return 0 | ||
} | ||
|
||
download_and_unzip_to() { | ||
local url="$1" | ||
local dir="$2" | ||
|
||
local tmp_file="$(mktemp)" | ||
|
||
download_to "$url" "$tmp_file" || return 1 | ||
|
||
unzip "$tmp_file" -d "$dir" || { | ||
echo_red "Unzip has failed..." | ||
rm -f "$tmp_file" | ||
return 1 | ||
} | ||
rm -f "$tmp_file" | ||
|
||
return 0 | ||
} | ||
|
||
get_latest_release() { | ||
curl --silent "https://api.github.com/repos/$1/releases/latest" | | ||
grep '"tag_name":' | | ||
sed -E 's/.*"([^"]+)".*/\1/' | ||
} | ||
|
||
__download_github_common() { | ||
|
@@ -100,6 +135,23 @@ setup_libiio() { | |
popd | ||
} | ||
|
||
setup_genalyzer() { | ||
[ ! -d "work/genalyzer" ] || return 0 | ||
|
||
__download_github_common genalyzer | ||
|
||
pushd work | ||
mkdir -p genalyzer/build | ||
pushd genalyzer/build | ||
|
||
cmake ../ -DPYTHON_BINDINGS=ON | ||
make -j3 | ||
sudo make install | ||
|
||
popd | ||
popd | ||
} | ||
|
||
setup_adm1266() { | ||
[ ! -d "src/adm1266" ] || return 0 | ||
#tbd : remove all redundant if BOARD checks ==removed== | ||
|
@@ -300,7 +352,6 @@ hdmi_cvt=800 480 60 6 0 0 0 | |
hdmi_drive=1 | ||
max_usb_current=1 | ||
|
||
dtoverlay=pi3-disable-wifi | ||
dtoverlay=pi3-disable-bt | ||
# --- end setup_env.sh | ||
EOF | ||
|
@@ -391,6 +442,16 @@ dhcp-range=192.168.0.100,192.168.0.150,24h | |
EOF | ||
} | ||
|
||
setup_sync_datetime() { | ||
sudo_required | ||
|
||
# Try to use NTP. May fail if there is no timesync service (e.g. systemd-timesyncd) | ||
sudo timedatectl set-ntp true && return | ||
|
||
# Alternatively, use a much less precise source, but still good enough for certificates to be valid | ||
sudo date +"%d %b %Y %T %Z" -s "$(curl -s --head http://google.com | grep '^Date:' | cut -d' ' -f 3-)" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just a nitpick but since this step and prereqs install require internet, maybe it would be useful to add a short connection check in the beginning of the script, to avoid going further if the device is not connected to the internet (maybe just a ping?) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does def3e61 look alright? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looks good to me |
||
} | ||
|
||
|
||
## Board Function Area ## | ||
|
||
|
@@ -447,8 +508,8 @@ pushd $SCRIPT_DIR | |
|
||
#TBD: move specific functions from this list into setup_board function | ||
STEPS="bashrc_update disable_sudo_passwd misc_profile_cleanup raspi_config xfce4_power_manager_settings" | ||
STEPS="$STEPS thunar_volman disable_lxde_automount apt_install_prereqs" | ||
STEPS="$STEPS write_autostart_config libiio" | ||
STEPS="$STEPS thunar_volman disable_lxde_automount sync_datetime apt_install_prereqs pip_install_prereqs" | ||
STEPS="$STEPS write_autostart_config libiio genalyzer" | ||
STEPS="$STEPS pi_boot_config disable_pi_screen_blanking" | ||
STEPS="$STEPS dhcp_config telemetry $BOARD" | ||
|
||
|
@@ -465,6 +526,8 @@ if [ "$RAN_ONCE" == "0" ] ; then | |
for step in $STEPS ; do | ||
echo_red " $step" | ||
done | ||
else | ||
echo_red "To properly finish the setup, reboot!" | ||
fi | ||
|
||
popd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this test_adrv9361_prod.py file actually exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was added in the fmcomms_scpi branch, commit 476bbcc.