--- /dev/null
+#!/bin/sh
+#
+# What to test
+# ------------
+# - Normal backup
+# - Weird backup
+# - Restore
+# - Accurate backup
+# - Compression
+# - Checksum
+# - TLS/Encryption
+# - compare files
+# - runscript
+#
+# How to use this test
+# --------------------
+#
+#
+TestName="remote-fd-test"
+JobName=backup
+. scripts/functions
+
+scripts/cleanup
+scripts/copy-test-confs
+
+change_jobname NightlySave $JobName
+change_jobname MonsterSave AccurateTest
+
+start_test
+
+echo $REMOTE_FILE/save > $tmp/file-list
+
+$bperl -e remote_stop
+$bperl -e remote_init
+$bperl -e remote_config
+
+$bperl -e "add_attribute('$conf/bacula-dir.conf', 'clientrunbeforejob', '$REMOTE_FILE/save/test.sh', 'Job', 'CompressedTest')"
+$bperl -e "add_attribute('$conf/bacula-dir.conf', 'accurate', 'yes', 'Job', 'AccurateTest')"
+$bperl -e "add_attribute('$conf/bacula-dir.conf', 'address', '$REMOTE_ADDR', 'Client')"
+$bperl -e "add_attribute('$conf/bacula-dir.conf', 'password', '$REMOTE_PASSWORD', 'Client')"
+$bperl -e "add_attribute('$conf/bacula-dir.conf', 'address', '$REMOTE_STORE_ADDR', 'Storage')"
+
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@output
+messages
+@$out ${cwd}/tmp/log1.out
+status client
+label storage=File volume=TestVolume001
+run job=$JobName storage=File yes
+wait
+messages
+@#
+@# now do a restore
+@#
+@$out ${cwd}/tmp/log2.out
+restore where=$REMOTE_FILE/restore select all done storage=File
+yes
+wait
+messages
+@$out ${cwd}/tmp/log3.out
+@#
+@# make some runscript tests
+@#
+run job=CompressedTest storage=File yes
+wait
+messages
+@$out ${cwd}/tmp/log1.out
+@#
+@# make some accurate tests
+@#
+run job=AccurateTest storage=File yes
+wait
+messages
+run job=AccurateTest storage=File yes
+wait
+messages
+@output
+quit
+END_OF_DATA
+
+run_bacula
+check_for_zombie_jobs storage=File
+stop_bacula
+
+check_two_logs
+
+grep 'this is a script' $tmp/log3.out > /dev/null
+if [ $? != 0 ]; then
+ print_debug "ERROR: Can't find runscript output"
+ bstat=1
+fi
+
+$bperl -e remote_diff
+if [ $? != 0 ]; then
+ dstat=1
+fi
+
+$bperl -e remote_stop
+
+end_test