In the referenced job the failure is not detected because in usr/local/bin/run-autopilot.sh (from container ps-radeon-hd8350:/var/lib/lxc/trusty-amd64-20131023-0529/) in install_debs() apt is called with:
You should do something like this instead
rc=0
sudo apt-get -y --force-yes install $package_list||rc=$? >> $AP_SETUP_LOGFILE
if [ $rc -gt 0 ]; then
# Terminate gracefully
...
In the referenced job the failure is not detected because in usr/local/ bin/run- autopilot. sh (from container ps-radeon- hd8350: /var/lib/ lxc/trusty- amd64-20131023- 0529/) in install_debs() apt is called with:
66 echo "Package list: ${package_list}" >> $AP_SETUP_LOGFILE
67 sudo apt-get -y --force-yes install $package_list >> $AP_SETUP_LOGFILE
and there is no error handling
You should do something like this instead list||rc= $? >> $AP_SETUP_LOGFILE
rc=0
sudo apt-get -y --force-yes install $package_
if [ $rc -gt 0 ]; then
# Terminate gracefully
...