selftest: Ensure we catch errors from samba-tool domain tombstones expunge
authorAndrew Bartlett <abartlet@samba.org>
Sun, 6 Nov 2016 22:58:04 +0000 (11:58 +1300)
committerGarming Sam <garming@samba.org>
Tue, 22 Nov 2016 01:10:16 +0000 (02:10 +0100)
The previous code would overwrite $? before the return, so always returned 0

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12297

testprogs/blackbox/tombstones-expunge.sh

index 33cb0b1be13170b1b215143ca347c61a4d71ac8e..e7e861fa3d382936a97e84d0dad2be59ae3d0ace 100755 (executable)
@@ -52,7 +52,7 @@ tombstones_expunge() {
 
     $PYTHON $BINDIR/samba-tool domain tombstones expunge -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb --current-time=2016-07-30 --tombstone-lifetime=4 > $tmpfile
     if [ "$?" != "0" ]; then
-       return $?
+       return 1
     fi
     diff $tmpfile $release_dir/expected-expunge-output.txt
     if [ "$?" != "0" ]; then