#!/bin/sh # Simple test that a DB from a backup file cannot be untarred and started # manually (you have to run the samba-tool 'backup restore' command instead). if [ $# -lt 1 ]; then cat <&1) if [ $? -eq 0 ]; then echo "ERROR: Samba should not have started successfully" return 1 fi # check the reason we're failing is because prime_ldb_databases() is # detecting that this is a backup DB (and not some other reason) echo "$OUTPUT" | grep "failed to start: Database is a backup" } # setup a DB and manually mark it as being a "backup" testit "provision" do_provision testit "add-backup-marker" add_backup_marker # check that Samba won't start using this DB (because it's a backup) testit "start-samba-backup" start_backup rm -rf $DBPATH exit $failed