diff --git a/systemtests/CMakeLists.txt b/systemtests/CMakeLists.txt index 99f2501c5a8..1394ea7b48e 100644 --- a/systemtests/CMakeLists.txt +++ b/systemtests/CMakeLists.txt @@ -266,10 +266,22 @@ MESSAGE(STATUS "PYTHON_FOUND: " ${PYTHON_FOUND}) MESSAGE(STATUS "PYTHON_SELENIUM_FOUND: " ${PYTHON_SELENIUM_FOUND}) MESSAGE(STATUS "CHROMEDRIVER_FOUND: " ${CHROMEDRIVER_FOUND}) +list(APPEND WEBUI_SELENIUM_TESTS + "webui-admin-client-disabling" + "webui-admin-rerun-job" + "webui-admin-restore" + "webui-admin-run-custom-job" + "webui-admin-run-job" + "webui-readonly-client-disabling" + "webui-readonly-rerun-job" + "webui-readonly-restore" + "webui-readonly-run-custom-job" + "webui-readonly-run-job") + IF(ENABLE_WEBUI_SELENIUM_TEST) - list(APPEND SYSTEM_TESTS "webui-selenium") + list(APPEND SYSTEM_TESTS ${WEBUI_SELENIUM_TESTS}) ELSE() - list(APPEND SYSTEM_TESTS_DISABLED "webui-selenium") + list(APPEND SYSTEM_TESTS_DISABLED ${WEBUI_SELENIUM_TESTS}) ENDIF() set(BASEPORT 42001) @@ -317,13 +329,17 @@ foreach(TEST_NAME ${SYSTEM_TESTS}) file(MAKE_DIRECTORY ${tmpdir}) file(MAKE_DIRECTORY ${working_dir}) - # webui-selenium - IF(${TEST_NAME} STREQUAL "webui-selenium") - set(WEBUICONFDIR ${current_test_directory}/etc/bareos-webui) #used for testenvironment settings - file(MAKE_DIRECTORY ${WEBUICONFDIR}) - configure_file("${CMAKE_SOURCE_DIR}/webui/config/autoload/global.php.in" "${current_test_directory}/webui/config/autoload/global.php" @ONLY) - configure_file("${CMAKE_SOURCE_DIR}/systemtests/tests/webui-selenium/directors.ini.in" "${current_test_directory}/etc/bareos-webui/directors.ini" @ONLY) - file(COPY "${CMAKE_SOURCE_DIR}/webui/install/configuration.ini" DESTINATION "${current_test_directory}/etc/bareos-webui/") + # webui specific settings + IF(ENABLE_WEBUI_SELENIUM_TEST) + foreach(SELENIUM_TEST ${WEBUI_SELENIUM_TESTS}) + IF(${TEST_NAME} STREQUAL SELENIUM_TEST) + set(WEBUICONFDIR ${current_test_directory}/etc/bareos-webui) # used for testenvironment settings + file(MAKE_DIRECTORY ${WEBUICONFDIR}) + configure_file("${CMAKE_SOURCE_DIR}/webui/config/autoload/global.php.in" "${current_test_directory}/webui/config/autoload/global.php" @ONLY) + configure_file("${CMAKE_SOURCE_DIR}/systemtests/tests/${TEST_NAME}/directors.ini.in" "${current_test_directory}/etc/bareos-webui/directors.ini" @ONLY) + file(COPY "${CMAKE_SOURCE_DIR}/webui/install/configuration.ini" DESTINATION "${current_test_directory}/etc/bareos-webui/") + ENDIF() + endforeach() ENDIF() ConfigureFilesToSystemtest("systemtests" "tests/${TEST_NAME}" "*" @ONLY) diff --git a/systemtests/scripts/cleanup b/systemtests/scripts/cleanup index e7a64ea7b0f..1965618dfb9 100755 --- a/systemtests/scripts/cleanup +++ b/systemtests/scripts/cleanup @@ -25,6 +25,8 @@ find . -name "gigaslam.gif" -exec rm -f {} \; #rm -rf ${conf}/bareos-dir-export/ #rm -rf ${conf}/tls/ +# cleanup chrome user data (selenium tests) +rm -rf /tmp/chrome-user-data-* #if [ -f ${scripts}/bareos ]; then # ${scripts}/bareos stop 2>&1 >/dev/null diff --git a/systemtests/tests/webui-selenium/directors.ini.in b/systemtests/tests/webui-admin-client-disabling/directors.ini.in similarity index 99% rename from systemtests/tests/webui-selenium/directors.ini.in rename to systemtests/tests/webui-admin-client-disabling/directors.ini.in index a6930caea3c..054b346838c 100644 --- a/systemtests/tests/webui-selenium/directors.ini.in +++ b/systemtests/tests/webui-admin-client-disabling/directors.ini.in @@ -79,4 +79,3 @@ dirport = 9101 ;cert_file = "" ;cert_file_passphrase = "" ;allowed_cns = "" - diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/console/admin.conf b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/console/admin.conf similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/console/admin.conf rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/console/admin.conf diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/console/readonly.conf b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/console/readonly.conf similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/console/readonly.conf rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/console/readonly.conf diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/fileset/Catalog.conf b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/fileset/Catalog.conf similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/fileset/Catalog.conf rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/fileset/Catalog.conf diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/fileset/SelfTest.conf b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/fileset/SelfTest.conf similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/fileset/SelfTest.conf rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/fileset/SelfTest.conf diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/fileset/SelfTest.conf.in b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/fileset/SelfTest.conf.in similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/fileset/SelfTest.conf.in rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/fileset/SelfTest.conf.in diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/fileset/Windows All Drives.conf b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/fileset/Windows All Drives.conf similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/fileset/Windows All Drives.conf rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/fileset/Windows All Drives.conf diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/job/BackupCatalog.conf.in b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/job/BackupCatalog.conf.in similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/job/BackupCatalog.conf.in rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/job/BackupCatalog.conf.in diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/messages/Daemon.conf.in b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/messages/Daemon.conf.in similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/messages/Daemon.conf.in rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/messages/Daemon.conf.in diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/messages/Standard.conf.in b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/messages/Standard.conf.in similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/messages/Standard.conf.in rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/messages/Standard.conf.in diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/pool/Differential.conf b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/pool/Differential.conf similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/pool/Differential.conf rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/pool/Differential.conf diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/pool/Full.conf b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/pool/Full.conf similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/pool/Full.conf rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/pool/Full.conf diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/pool/Incremental.conf b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/pool/Incremental.conf similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/pool/Incremental.conf rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/pool/Incremental.conf diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/pool/Scratch.conf b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/pool/Scratch.conf similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/pool/Scratch.conf rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/pool/Scratch.conf diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/profile/operator.conf b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/profile/operator.conf similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/profile/operator.conf rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/profile/operator.conf diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/profile/webui-admin.conf b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/profile/webui-admin.conf similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/profile/webui-admin.conf rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/profile/webui-admin.conf diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/profile/webui-readonly.conf b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/profile/webui-readonly.conf similarity index 99% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/profile/webui-readonly.conf rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/profile/webui-readonly.conf index 5e3ee619c6c..fde80e8d4c0 100644 --- a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/profile/webui-readonly.conf +++ b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/profile/webui-readonly.conf @@ -35,4 +35,3 @@ Profile { # Allow access to restore to any filesystem location Where ACL = *all* } - diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/storage/File.conf.in b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/storage/File.conf.in similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-dir.d/storage/File.conf.in rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-dir.d/storage/File.conf.in diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-fd.d/client/myself.conf.in b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-fd.d/client/myself.conf.in similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-fd.d/client/myself.conf.in rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-fd.d/client/myself.conf.in diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-fd.d/messages/Standard.conf b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-fd.d/messages/Standard.conf similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-fd.d/messages/Standard.conf rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-fd.d/messages/Standard.conf diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-sd.d/device/FileStorage.conf.in b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-sd.d/device/FileStorage.conf.in similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-sd.d/device/FileStorage.conf.in rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-sd.d/device/FileStorage.conf.in diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-sd.d/messages/Standard.conf b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-sd.d/messages/Standard.conf similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-sd.d/messages/Standard.conf rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-sd.d/messages/Standard.conf diff --git a/systemtests/tests/webui-selenium/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in diff --git a/systemtests/tests/webui-selenium/etc/bareos/bconsole.conf.in b/systemtests/tests/webui-admin-client-disabling/etc/bareos/bconsole.conf.in similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/bconsole.conf.in rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/bconsole.conf.in diff --git a/systemtests/tests/webui-selenium/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in b/systemtests/tests/webui-admin-client-disabling/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in diff --git a/systemtests/tests/webui-selenium/etc/bareos/tray-monitor.d/director/Director-local.conf.in b/systemtests/tests/webui-admin-client-disabling/etc/bareos/tray-monitor.d/director/Director-local.conf.in similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/tray-monitor.d/director/Director-local.conf.in rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/tray-monitor.d/director/Director-local.conf.in diff --git a/systemtests/tests/webui-selenium/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in b/systemtests/tests/webui-admin-client-disabling/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in diff --git a/systemtests/tests/webui-selenium/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in b/systemtests/tests/webui-admin-client-disabling/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in similarity index 100% rename from systemtests/tests/webui-selenium/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in rename to systemtests/tests/webui-admin-client-disabling/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in diff --git a/systemtests/tests/webui-admin-client-disabling/testrunner.in b/systemtests/tests/webui-admin-client-disabling/testrunner.in new file mode 100755 index 00000000000..41dc99c52a5 --- /dev/null +++ b/systemtests/tests/webui-admin-client-disabling/testrunner.in @@ -0,0 +1,60 @@ +#!/bin/sh +# +# Run a simple backup +# then restore it. +# +TestName="$(basename "$(pwd)")" +export TestName + +JobName=backup-bareos-fd +. ./environment +. ${scripts}/functions + +${scripts}/cleanup +${scripts}/setup + + +# Directory to backup. +# This directory will be created by setup_data(). +BackupDirectory="${tmp}/data" + +# Use a tgz to setup data to be backed up. +# Data will be placed at "${tmp}/data/". +setup_data + +start_test + +cat <$tmp/bconcmds +@$out /dev/null +messages +@$out $tmp/log1.out +run job=$JobName yes +wait +messages +quit +END_OF_DATA + +run_bareos + +@PHP@ -S 127.0.0.1:@php_port@ -t @PROJECT_SOURCE_DIR@/../webui/public/ >"$tmp/php.out" 2>&1 & + +PHP_PID=$(echo $!) + +# run tests but stop the test run on the first error or failure + +# +# test with admin profile resource +# +export BAREOS_WEBUI_PROFILE=admin +export BAREOS_WEBUI_TESTNAME=test_client_disabling +echo "test with admin profile:" >"$tmp/selenium.out" 2>&1 +@PYTHON@ @CMAKE_SOURCE_DIR@/webui/tests/selenium/webui-selenium-test.py -v SeleniumTest.test_client_disabling >>"$tmp/selenium.out" 2>&1 + +estat=$? +export estat + +kill "${PHP_PID}" + +stop_bareos + +end_test diff --git a/systemtests/tests/webui-admin-rerun-job/directors.ini.in b/systemtests/tests/webui-admin-rerun-job/directors.ini.in new file mode 100644 index 00000000000..054b346838c --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/directors.ini.in @@ -0,0 +1,81 @@ +; +; Bareos WebUI Configuration File +; +; File: /usr/local/etc/bareos-webui/directors.ini +; + +;------------------------------------------------------------------------------ +; Section localhost-dir +;------------------------------------------------------------------------------ +[localhost-dir] + +; Enable or disable section. Possible values are "yes" or "no", the default is "yes". +enabled = "yes" + +; Fill in the IP-Address or FQDN of you director. +diraddress = "localhost" + +; Default value is 9101 +dirport = @dir_port@ + +; Set catalog to explicit value if you have multiple catalogs +;catalog = "MyCatalog" + +; Set the console name and password for a dedicated pam console; +; the counterpart console-config in the director must have set +; UsePamAuthentication = yes +;pam_console_name = "admin" +;pam_console_password = "admin" + +; TLS verify peer +; Possible values: true or false +tls_verify_peer = false + +; Server can do TLS +; Possible values: true or false +server_can_do_tls = false + +; Server requires TLS +; Possible values: true or false +server_requires_tls = false + +; Client can do TLS +; Possible values: true or false +client_can_do_tls = false + +; Client requires TLS +; Possible value: true or false +client_requires_tls = false + +; Path to the certificate authority file +; E.g. ca_file = "/usr/local/etc/bareos/tls/BareosCA.crt" +;ca_file = "" + +; Path to the cert file which needs to contain the client certificate and the key in PEM encoding +; E.g. ca_file = "/usr/local/etc/bareos/tls/restricted-named-console.pem" +;cert_file = "" + +; Passphrase needed to unlock the above cert file if set +;cert_file_passphrase = "" + +; Allowed common names +; E.g. allowed_cns = "host1.example.com" +;allowed_cns = "" + +;------------------------------------------------------------------------------ +; Section another-host-dir +;------------------------------------------------------------------------------ +[another-host-dir] +enabled = "no" +diraddress = "192.168.120.1" +dirport = 9101 +;catalog = "MyCatalog" +;tls_verify_peer = false +;server_can_do_tls = false +;server_requires_tls = false +;client_can_do_tls = false +;client_requires_tls = false +;ca_file = "" +;cert_file = "" +;cert_file_passphrase = "" +;allowed_cns = "" diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in new file mode 100644 index 00000000000..479bc6fecbb --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in @@ -0,0 +1,8 @@ +Catalog { + Name = MyCatalog + #dbdriver = "@DEFAULT_DB_TYPE@" + dbdriver = "XXX_REPLACE_WITH_DATABASE_DRIVER_XXX" + dbname = "@db_name@" + dbuser = "@db_user@" + dbpassword = "@db_password@" +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in new file mode 100644 index 00000000000..470ca702035 --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in @@ -0,0 +1,7 @@ +Client { + Name = bareos-fd + Description = "Client resource of the Director itself." + Address = localhost + Password = "@fd_password@" # password for FileDaemon + FD PORT = @fd_port@ +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/console/admin.conf b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/console/admin.conf new file mode 100644 index 00000000000..fe312662e3e --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/console/admin.conf @@ -0,0 +1,17 @@ +# +# Restricted console used by bareos-webui +# +Console { + Name = admin + Password = "admin" + Profile = "webui-admin" + + + # As php does not support TLS-PSK, + # and the director has TLS enabled by default, + # we need to either disable TLS or setup + # TLS with certificates. + # + # For testing purposes we disable it here + TLS Enable = No +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in new file mode 100644 index 00000000000..d276adcb87d --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in @@ -0,0 +1,7 @@ +Console { + Name = bareos-mon + Description = "Restricted console used by tray-monitor to get the status of the director." + Password = "@mon_dir_password@" + CommandACL = status, .status + JobACL = *all* +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/console/readonly.conf b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/console/readonly.conf new file mode 100644 index 00000000000..0ff95010efd --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/console/readonly.conf @@ -0,0 +1,17 @@ +# +# Restricted console used by bareos-webui +# +Console { + Name = readonly + Password = "readonly" + Profile = "webui-readonly" + + + # As php does not support TLS-PSK, + # and the director has TLS enabled by default, + # we need to either disable TLS or setup + # TLS with certificates. + # + # For testing purposes we disable it here + TLS Enable = No +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in new file mode 100644 index 00000000000..33b3a426e3a --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in @@ -0,0 +1,27 @@ +Director { # define myself + Name = bareos-dir + QueryFile = "@scriptdir@/query.sql" + Maximum Concurrent Jobs = 10 + Password = "@dir_password@" # Console password + Messages = Daemon + Auditing = yes + + # Enable the Heartbeat if you experience connection losses + # (eg. because of your router or firewall configuration). + # Additionally the Heartbeat can be enabled in bareos-sd and bareos-fd. + # + # Heartbeat Interval = 1 min + + # remove comment in next line to load dynamic backends from specified directory + Backend Directory = @backenddir@ + + # remove comment from "Plugin Directory" to load plugins from specified directory. + # if "Plugin Names" is defined, only the specified plugins will be loaded, + # otherwise all director plugins (*-dir.so) from the "Plugin Directory". + # + # Plugin Directory = "@python_plugin_module_src_dir@" + # Plugin Names = "" + Working Directory = "@working_dir@" + Pid Directory = "@piddir@" + DirPort = @dir_port@ +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf new file mode 100644 index 00000000000..ec1a47c971b --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf @@ -0,0 +1,11 @@ +FileSet { + Name = "Catalog" + Description = "Backup the catalog dump and Bareos configuration files." + Include { + Options { + signature = MD5 + } + File = "/var/lib/bareos/bareos.sql" # database dump + File = "/usr/local/etc/bareos" # configuration + } +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in new file mode 100644 index 00000000000..c7cdc433fe1 --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in @@ -0,0 +1,11 @@ +FileSet { + Name = "Catalog" + Description = "Backup the catalog dump and Bareos configuration files." + Include { + Options { + signature = MD5 + } + File = "@working_dir@/@db_name@.sql" # database dump + File = "@confdir@" # configuration + } +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf new file mode 100644 index 00000000000..3a3336823ac --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf @@ -0,0 +1,31 @@ +FileSet { + Name = "LinuxAll" + Description = "Backup all regular filesystems, determined by filesystem type." + Include { + Options { + Signature = MD5 # calculate md5 checksum per file + One FS = No # change into other filessytems + FS Type = btrfs + FS Type = ext2 # filesystems of given types will be backed up + FS Type = ext3 # others will be ignored + FS Type = ext4 + FS Type = reiserfs + FS Type = jfs + FS Type = xfs + FS Type = zfs + } + File = / + } + # Things that usually have to be excluded + # You have to exclude /var/lib/bareos/storage + # on your bareos server + Exclude { + File = /var/lib/bareos + File = /var/lib/bareos/storage + File = /proc + File = /tmp + File = /var/tmp + File = /.journal + File = /.fsck + } +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in new file mode 100644 index 00000000000..cee45dfa3ed --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in @@ -0,0 +1,31 @@ +FileSet { + Name = "LinuxAll" + Description = "Backup all regular filesystems, determined by filesystem type." + Include { + Options { + Signature = MD5 # calculate md5 checksum per file + One FS = No # change into other filessytems + FS Type = btrfs + FS Type = ext2 # filesystems of given types will be backed up + FS Type = ext3 # others will be ignored + FS Type = ext4 + FS Type = reiserfs + FS Type = jfs + FS Type = xfs + FS Type = zfs + } + File = / + } + # Things that usually have to be excluded + # You have to exclude @archivedir@ + # on your bareos server + Exclude { + File = @working_dir@ + File = @archivedir@ + File = /proc + File = /tmp + File = /var/tmp + File = /.journal + File = /.fsck + } +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/fileset/SelfTest.conf b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/fileset/SelfTest.conf new file mode 100644 index 00000000000..a117233f531 --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/fileset/SelfTest.conf @@ -0,0 +1,11 @@ +FileSet { + Name = "SelfTest" + Description = "fileset just to backup some files for selftest" + Include { + Options { + Signature = MD5 # calculate md5 checksum per file + } + #File = "/usr/local/sbin" + File= + RunBeforeJob = "@scriptdir@/make_catalog_backup.pl MyCatalog" + + # This deletes the copy of the catalog + RunAfterJob = "@scriptdir@/delete_catalog_backup" + + # This sends the bootstrap via mail for disaster recovery. + # Should be sent to another system, please change recipient accordingly + Write Bootstrap = "|@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \" -s \"Bootstrap for Job %j\" @job_email@" # (#01) + Priority = 11 # run after main backup +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in new file mode 100644 index 00000000000..577f6f9b6bb --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in @@ -0,0 +1,11 @@ +Job { + Name = "RestoreFiles" + Description = "Standard Restore template. Only one such job is needed for all standard Jobs/Clients/Storage ..." + Type = Restore + Client = bareos-fd + FileSet = "LinuxAll" + Storage = File + Pool = Incremental + Messages = Standard + Where = @tmp@/bareos-restores +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in new file mode 100644 index 00000000000..ca1891f9620 --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in @@ -0,0 +1,5 @@ +Job { + Name = "backup-bareos-fd" + JobDefs = "DefaultJob" + Client = "bareos-fd" +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in new file mode 100644 index 00000000000..0d1c0bd04e7 --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in @@ -0,0 +1,16 @@ +JobDefs { + Name = "DefaultJob" + Type = Backup + Level = Incremental + Client = bareos-fd + FileSet = "SelfTest" # selftest fileset (#13) + Schedule = "WeeklyCycle" + Storage = File + Messages = Standard + Pool = Incremental + Priority = 10 + Write Bootstrap = "@working_dir@/%c.bsr" + Full Backup Pool = Full # write Full Backups into "Full" Pool (#05) + Differential Backup Pool = Differential # write Diff Backups into "Differential" Pool (#08) + Incremental Backup Pool = Incremental # write Incr Backups into "Incremental" Pool (#11) +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/messages/Daemon.conf.in b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/messages/Daemon.conf.in new file mode 100644 index 00000000000..ce0e5ec6778 --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/messages/Daemon.conf.in @@ -0,0 +1,9 @@ +Messages { + Name = Daemon + Description = "Message delivery for daemon messages (no job)." + mailcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos daemon message\" %r" + mail = @job_email@ = all, !skipped, !audit # (#02) + console = all, !skipped, !saved, !audit + append = "@logdir@/bareos.log" = all, !skipped, !audit + append = "@logdir@/bareos-audit.log" = audit +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/messages/Standard.conf.in b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/messages/Standard.conf.in new file mode 100644 index 00000000000..fdcc1f735e5 --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/messages/Standard.conf.in @@ -0,0 +1,11 @@ +Messages { + Name = Standard + Description = "Reasonable message delivery -- send most everything to email address and to the console." + operatorcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos: Intervention needed for %j\" %r" + mailcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos: %t %e of %c %l\" %r" + operator = @job_email@ = mount # (#03) + mail = @job_email@ = all, !skipped, !saved, !audit # (#02) + console = all, !skipped, !saved, !audit + append = "@logdir@/bareos.log" = all, !skipped, !saved, !audit + catalog = all, !skipped, !saved, !audit +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/pool/Differential.conf b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/pool/Differential.conf new file mode 100644 index 00000000000..25ce24821ab --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/pool/Differential.conf @@ -0,0 +1,10 @@ +Pool { + Name = Differential + Pool Type = Backup + Recycle = yes # Bareos can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 90 days # How long should the Differential Backups be kept? (#09) + Maximum Volume Bytes = 10G # Limit Volume size to something reasonable + Maximum Volumes = 100 # Limit number of Volumes in Pool + Label Format = "Differential-" # Volumes will be labeled "Differential-" +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/pool/Full.conf b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/pool/Full.conf new file mode 100644 index 00000000000..867fc66b483 --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/pool/Full.conf @@ -0,0 +1,10 @@ +Pool { + Name = Full + Pool Type = Backup + Recycle = yes # Bareos can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 365 days # How long should the Full Backups be kept? (#06) + Maximum Volume Bytes = 50G # Limit Volume size to something reasonable + Maximum Volumes = 100 # Limit number of Volumes in Pool + Label Format = "Full-" # Volumes will be labeled "Full-" +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/pool/Incremental.conf b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/pool/Incremental.conf new file mode 100644 index 00000000000..f4dbbab6650 --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/pool/Incremental.conf @@ -0,0 +1,10 @@ +Pool { + Name = Incremental + Pool Type = Backup + Recycle = yes # Bareos can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 30 days # How long should the Incremental Backups be kept? (#12) + Maximum Volume Bytes = 1G # Limit Volume size to something reasonable + Maximum Volumes = 100 # Limit number of Volumes in Pool + Label Format = "Incremental-" # Volumes will be labeled "Incremental-" +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/pool/Scratch.conf b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/pool/Scratch.conf new file mode 100644 index 00000000000..3a489b19871 --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/pool/Scratch.conf @@ -0,0 +1,4 @@ +Pool { + Name = Scratch + Pool Type = Scratch +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/profile/operator.conf b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/profile/operator.conf new file mode 100644 index 00000000000..6edd0166dca --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/profile/operator.conf @@ -0,0 +1,18 @@ +Profile { + Name = operator + Description = "Profile allowing normal Bareos operations." + + Command ACL = !.bvfs_clear_cache, !.exit, !.sql + Command ACL = !configure, !create, !delete, !purge, !prune, !sqlquery, !umount, !unmount + Command ACL = *all* + + Catalog ACL = *all* + Client ACL = *all* + FileSet ACL = *all* + Job ACL = *all* + Plugin Options ACL = *all* + Pool ACL = *all* + Schedule ACL = *all* + Storage ACL = *all* + Where ACL = *all* +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/profile/webui-admin.conf b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/profile/webui-admin.conf new file mode 100644 index 00000000000..860af09e4fa --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/profile/webui-admin.conf @@ -0,0 +1,15 @@ +# +# bareos-webui webui-admin profile resource +# +Profile { + Name = "webui-admin" + CommandACL = !.bvfs_clear_cache, !.exit, !.sql, !configure, !create, !delete, !purge, !prune, !sqlquery, !umount, !unmount, *all* + Job ACL = *all* + Schedule ACL = *all* + Catalog ACL = *all* + Pool ACL = *all* + Storage ACL = *all* + Client ACL = *all* + FileSet ACL = *all* + Where ACL = *all* +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/profile/webui-readonly.conf b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/profile/webui-readonly.conf new file mode 100644 index 00000000000..fde80e8d4c0 --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/profile/webui-readonly.conf @@ -0,0 +1,37 @@ +# +# bareos-webui profile resource: read-only access +# + +Profile { + Name = "webui-readonly" + + # Allow access to the following commands + CommandACL = .api, .help, use, version, status + CommandACL = list, llist + CommandACL = .clients, .jobs, .filesets, .pools, .storages, .defaults, .schedule + CommandACL = .bvfs_lsdirs, .bvfs_lsfiles, .bvfs_update, .bvfs_get_jobids, .bvfs_versions, .bvfs_restore + + # Allow access to the following job resources + Job ACL = *all* + + # Allow access to the following schedule resources + Schedule ACL = *all* + + # Allow access to the following catalog resources + Catalog ACL = *all* + + # Allow access to the following pool resources + Pool ACL = *all* + + # Allow access to the following storage resources + Storage ACL = *all* + + # Allow access to the following client resources + Client ACL = *all* + + # Allow access to the following filset resources + FileSet ACL = *all* + + # Allow access to restore to any filesystem location + Where ACL = *all* +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf new file mode 100644 index 00000000000..a2181c7db3d --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf @@ -0,0 +1,6 @@ +Schedule { + Name = "WeeklyCycle" +# Run = Full 1st sat at 21:00 # (#04) +# Run = Differential 2nd-5th sat at 21:00 # (#07) +# Run = Incremental mon-fri at 21:00 # (#10) +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf new file mode 100644 index 00000000000..49b245671cb --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf @@ -0,0 +1,5 @@ +Schedule { + Name = "WeeklyCycleAfterBackup" + Description = "This schedule does the catalog. It starts after the WeeklyCycle." +# Run = Full mon-fri at 21:10 +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/storage/File.conf.in b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/storage/File.conf.in new file mode 100644 index 00000000000..4058ddc7edc --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-dir.d/storage/File.conf.in @@ -0,0 +1,8 @@ +Storage { + Name = File + Address = @hostname@ # N.B. Use a fully qualified name here (do not use "localhost" here). + Password = "@sd_password@" + Device = FileStorage + Media Type = File + SD Port = @sd_port@ +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-fd.d/client/myself.conf.in b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-fd.d/client/myself.conf.in new file mode 100644 index 00000000000..e218bf06514 --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-fd.d/client/myself.conf.in @@ -0,0 +1,20 @@ +Client { + Name = @basename@-fd + Maximum Concurrent Jobs = 20 + + # remove comment from "Plugin Directory" to load plugins from specified directory. + # if "Plugin Names" is defined, only the specified plugins will be loaded, + # otherwise all filedaemon plugins (*-fd.so) from the "Plugin Directory". + # + # Plugin Directory = "@python_plugin_module_src_fd@" + # Plugin Names = "" + + # if compatible is set to yes, we are compatible with bacula + # if set to no, new bareos features are enabled which is the default + # compatible = yes + + Working Directory = "@working_dir@" + Pid Directory = "@piddir@" + FD Port = @fd_port@ + +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in new file mode 100644 index 00000000000..c8dc7085a45 --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in @@ -0,0 +1,5 @@ +Director { + Name = bareos-dir + Password = "@fd_password@" + Description = "Allow the configured Director to access this file daemon." +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in new file mode 100644 index 00000000000..630c3a9abd3 --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in @@ -0,0 +1,6 @@ +Director { + Name = bareos-mon + Password = "@mon_fd_password@" + Monitor = yes + Description = "Restricted Director, used by tray-monitor to get the status of this file daemon." +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-fd.d/messages/Standard.conf b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-fd.d/messages/Standard.conf new file mode 100644 index 00000000000..97788e00573 --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-fd.d/messages/Standard.conf @@ -0,0 +1,5 @@ +Messages { + Name = Standard + Director = bareos-dir = all, !skipped, !restored + Description = "Send relevant messages to the Director." +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-sd.d/device/FileStorage.conf.in b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-sd.d/device/FileStorage.conf.in new file mode 100644 index 00000000000..d7f2d1dcf19 --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-sd.d/device/FileStorage.conf.in @@ -0,0 +1,11 @@ +Device { + Name = FileStorage + Media Type = File + Archive Device = @archivedir@ + LabelMedia = yes; # lets Bareos label unlabeled media + Random Access = yes; + AutomaticMount = yes; # when device opened, read it + RemovableMedia = no; + AlwaysOpen = no; + Description = "File device. A connecting Director must have the same Name and MediaType." +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in new file mode 100644 index 00000000000..deef3360c2d --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in @@ -0,0 +1,5 @@ +Director { + Name = bareos-dir + Password = "@sd_password@" + Description = "Director, who is permitted to contact this storage daemon." +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in new file mode 100644 index 00000000000..e3cfdee6315 --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in @@ -0,0 +1,6 @@ +Director { + Name = bareos-mon + Password = "@mon_sd_password@" + Monitor = yes + Description = "Restricted Director, used by tray-monitor to get the status of this storage daemon." +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-sd.d/messages/Standard.conf b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-sd.d/messages/Standard.conf new file mode 100644 index 00000000000..468348e62fc --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-sd.d/messages/Standard.conf @@ -0,0 +1,5 @@ +Messages { + Name = Standard + Director = bareos-dir = all + Description = "Send all messages to the Director." +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in new file mode 100644 index 00000000000..3e1723fa60c --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in @@ -0,0 +1,14 @@ +Storage { + Name = bareos-sd + Maximum Concurrent Jobs = 20 + + # remove comment from "Plugin Directory" to load plugins from specified directory. + # if "Plugin Names" is defined, only the specified plugins will be loaded, + # otherwise all storage plugins (*-sd.so) from the "Plugin Directory". + # + # Plugin Directory = "@python_plugin_module_src_sd@" + # Plugin Names = "" + Working Directory = "@working_dir@" + Pid Directory = "@piddir@" + SD Port = @sd_port@ +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/bconsole.conf.in b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bconsole.conf.in new file mode 100644 index 00000000000..ecb6ad00dce --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/bconsole.conf.in @@ -0,0 +1,10 @@ +# +# Bareos User Agent (or Console) Configuration File +# + +Director { + Name = @basename@-dir + DIRport = @dir_port@ + address = @hostname@ + Password = "@dir_password@" +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in b/systemtests/tests/webui-admin-rerun-job/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in new file mode 100644 index 00000000000..dd00dd9f103 --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in @@ -0,0 +1,5 @@ +Client { + Name = @basename@-fd + Address = localhost + Password = "@mon_fd_password@" # password for FileDaemon +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/tray-monitor.d/director/Director-local.conf.in b/systemtests/tests/webui-admin-rerun-job/etc/bareos/tray-monitor.d/director/Director-local.conf.in new file mode 100644 index 00000000000..55dae492250 --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/tray-monitor.d/director/Director-local.conf.in @@ -0,0 +1,4 @@ +Director { + Name = bareos-dir + Address = localhost +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in b/systemtests/tests/webui-admin-rerun-job/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in new file mode 100644 index 00000000000..cddfa253945 --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in @@ -0,0 +1,7 @@ +Monitor { + # Name to establish connections to Director Console, Storage Daemon and File Daemon. + Name = bareos-mon + # Password to access the Director + Password = "@mon_dir_password@" # password for the Directors + RefreshInterval = 30 seconds +} diff --git a/systemtests/tests/webui-admin-rerun-job/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in b/systemtests/tests/webui-admin-rerun-job/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in new file mode 100644 index 00000000000..6538f4fd248 --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in @@ -0,0 +1,5 @@ +Storage { + Name = bareos-sd + Address = localhost + Password = "@mon_sd_password@" # password for StorageDaemon +} diff --git a/systemtests/tests/webui-admin-rerun-job/testrunner.in b/systemtests/tests/webui-admin-rerun-job/testrunner.in new file mode 100755 index 00000000000..57eac201032 --- /dev/null +++ b/systemtests/tests/webui-admin-rerun-job/testrunner.in @@ -0,0 +1,60 @@ +#!/bin/sh +# +# Run a simple backup +# then restore it. +# +TestName="$(basename "$(pwd)")" +export TestName + +JobName=backup-bareos-fd +. ./environment +. ${scripts}/functions + +${scripts}/cleanup +${scripts}/setup + + +# Directory to backup. +# This directory will be created by setup_data(). +BackupDirectory="${tmp}/data" + +# Use a tgz to setup data to be backed up. +# Data will be placed at "${tmp}/data/". +setup_data + +start_test + +cat <$tmp/bconcmds +@$out /dev/null +messages +@$out $tmp/log1.out +run job=$JobName yes +wait +messages +quit +END_OF_DATA + +run_bareos + +@PHP@ -S 127.0.0.1:@php_port@ -t @PROJECT_SOURCE_DIR@/../webui/public/ >"$tmp/php.out" 2>&1 & + +PHP_PID=$(echo $!) + +# run tests but stop the test run on the first error or failure + +# +# test with admin profile resource +# +export BAREOS_WEBUI_PROFILE=admin +export BAREOS_WEBUI_TESTNAME=test_rerun_job +echo "test with admin profile:" >"$tmp/selenium.out" 2>&1 +@PYTHON@ @CMAKE_SOURCE_DIR@/webui/tests/selenium/webui-selenium-test.py -v SeleniumTest.test_rerun_job >>"$tmp/selenium.out" 2>&1 + +estat=$? +export estat + +kill "${PHP_PID}" + +stop_bareos + +end_test diff --git a/systemtests/tests/webui-admin-restore/directors.ini.in b/systemtests/tests/webui-admin-restore/directors.ini.in new file mode 100644 index 00000000000..054b346838c --- /dev/null +++ b/systemtests/tests/webui-admin-restore/directors.ini.in @@ -0,0 +1,81 @@ +; +; Bareos WebUI Configuration File +; +; File: /usr/local/etc/bareos-webui/directors.ini +; + +;------------------------------------------------------------------------------ +; Section localhost-dir +;------------------------------------------------------------------------------ +[localhost-dir] + +; Enable or disable section. Possible values are "yes" or "no", the default is "yes". +enabled = "yes" + +; Fill in the IP-Address or FQDN of you director. +diraddress = "localhost" + +; Default value is 9101 +dirport = @dir_port@ + +; Set catalog to explicit value if you have multiple catalogs +;catalog = "MyCatalog" + +; Set the console name and password for a dedicated pam console; +; the counterpart console-config in the director must have set +; UsePamAuthentication = yes +;pam_console_name = "admin" +;pam_console_password = "admin" + +; TLS verify peer +; Possible values: true or false +tls_verify_peer = false + +; Server can do TLS +; Possible values: true or false +server_can_do_tls = false + +; Server requires TLS +; Possible values: true or false +server_requires_tls = false + +; Client can do TLS +; Possible values: true or false +client_can_do_tls = false + +; Client requires TLS +; Possible value: true or false +client_requires_tls = false + +; Path to the certificate authority file +; E.g. ca_file = "/usr/local/etc/bareos/tls/BareosCA.crt" +;ca_file = "" + +; Path to the cert file which needs to contain the client certificate and the key in PEM encoding +; E.g. ca_file = "/usr/local/etc/bareos/tls/restricted-named-console.pem" +;cert_file = "" + +; Passphrase needed to unlock the above cert file if set +;cert_file_passphrase = "" + +; Allowed common names +; E.g. allowed_cns = "host1.example.com" +;allowed_cns = "" + +;------------------------------------------------------------------------------ +; Section another-host-dir +;------------------------------------------------------------------------------ +[another-host-dir] +enabled = "no" +diraddress = "192.168.120.1" +dirport = 9101 +;catalog = "MyCatalog" +;tls_verify_peer = false +;server_can_do_tls = false +;server_requires_tls = false +;client_can_do_tls = false +;client_requires_tls = false +;ca_file = "" +;cert_file = "" +;cert_file_passphrase = "" +;allowed_cns = "" diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in new file mode 100644 index 00000000000..479bc6fecbb --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in @@ -0,0 +1,8 @@ +Catalog { + Name = MyCatalog + #dbdriver = "@DEFAULT_DB_TYPE@" + dbdriver = "XXX_REPLACE_WITH_DATABASE_DRIVER_XXX" + dbname = "@db_name@" + dbuser = "@db_user@" + dbpassword = "@db_password@" +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in new file mode 100644 index 00000000000..470ca702035 --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in @@ -0,0 +1,7 @@ +Client { + Name = bareos-fd + Description = "Client resource of the Director itself." + Address = localhost + Password = "@fd_password@" # password for FileDaemon + FD PORT = @fd_port@ +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/console/admin.conf b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/console/admin.conf new file mode 100644 index 00000000000..fe312662e3e --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/console/admin.conf @@ -0,0 +1,17 @@ +# +# Restricted console used by bareos-webui +# +Console { + Name = admin + Password = "admin" + Profile = "webui-admin" + + + # As php does not support TLS-PSK, + # and the director has TLS enabled by default, + # we need to either disable TLS or setup + # TLS with certificates. + # + # For testing purposes we disable it here + TLS Enable = No +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in new file mode 100644 index 00000000000..d276adcb87d --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in @@ -0,0 +1,7 @@ +Console { + Name = bareos-mon + Description = "Restricted console used by tray-monitor to get the status of the director." + Password = "@mon_dir_password@" + CommandACL = status, .status + JobACL = *all* +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/console/readonly.conf b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/console/readonly.conf new file mode 100644 index 00000000000..0ff95010efd --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/console/readonly.conf @@ -0,0 +1,17 @@ +# +# Restricted console used by bareos-webui +# +Console { + Name = readonly + Password = "readonly" + Profile = "webui-readonly" + + + # As php does not support TLS-PSK, + # and the director has TLS enabled by default, + # we need to either disable TLS or setup + # TLS with certificates. + # + # For testing purposes we disable it here + TLS Enable = No +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in new file mode 100644 index 00000000000..33b3a426e3a --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in @@ -0,0 +1,27 @@ +Director { # define myself + Name = bareos-dir + QueryFile = "@scriptdir@/query.sql" + Maximum Concurrent Jobs = 10 + Password = "@dir_password@" # Console password + Messages = Daemon + Auditing = yes + + # Enable the Heartbeat if you experience connection losses + # (eg. because of your router or firewall configuration). + # Additionally the Heartbeat can be enabled in bareos-sd and bareos-fd. + # + # Heartbeat Interval = 1 min + + # remove comment in next line to load dynamic backends from specified directory + Backend Directory = @backenddir@ + + # remove comment from "Plugin Directory" to load plugins from specified directory. + # if "Plugin Names" is defined, only the specified plugins will be loaded, + # otherwise all director plugins (*-dir.so) from the "Plugin Directory". + # + # Plugin Directory = "@python_plugin_module_src_dir@" + # Plugin Names = "" + Working Directory = "@working_dir@" + Pid Directory = "@piddir@" + DirPort = @dir_port@ +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/fileset/Catalog.conf b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/fileset/Catalog.conf new file mode 100644 index 00000000000..ec1a47c971b --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/fileset/Catalog.conf @@ -0,0 +1,11 @@ +FileSet { + Name = "Catalog" + Description = "Backup the catalog dump and Bareos configuration files." + Include { + Options { + signature = MD5 + } + File = "/var/lib/bareos/bareos.sql" # database dump + File = "/usr/local/etc/bareos" # configuration + } +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in new file mode 100644 index 00000000000..c7cdc433fe1 --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in @@ -0,0 +1,11 @@ +FileSet { + Name = "Catalog" + Description = "Backup the catalog dump and Bareos configuration files." + Include { + Options { + signature = MD5 + } + File = "@working_dir@/@db_name@.sql" # database dump + File = "@confdir@" # configuration + } +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf new file mode 100644 index 00000000000..3a3336823ac --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf @@ -0,0 +1,31 @@ +FileSet { + Name = "LinuxAll" + Description = "Backup all regular filesystems, determined by filesystem type." + Include { + Options { + Signature = MD5 # calculate md5 checksum per file + One FS = No # change into other filessytems + FS Type = btrfs + FS Type = ext2 # filesystems of given types will be backed up + FS Type = ext3 # others will be ignored + FS Type = ext4 + FS Type = reiserfs + FS Type = jfs + FS Type = xfs + FS Type = zfs + } + File = / + } + # Things that usually have to be excluded + # You have to exclude /var/lib/bareos/storage + # on your bareos server + Exclude { + File = /var/lib/bareos + File = /var/lib/bareos/storage + File = /proc + File = /tmp + File = /var/tmp + File = /.journal + File = /.fsck + } +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in new file mode 100644 index 00000000000..cee45dfa3ed --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in @@ -0,0 +1,31 @@ +FileSet { + Name = "LinuxAll" + Description = "Backup all regular filesystems, determined by filesystem type." + Include { + Options { + Signature = MD5 # calculate md5 checksum per file + One FS = No # change into other filessytems + FS Type = btrfs + FS Type = ext2 # filesystems of given types will be backed up + FS Type = ext3 # others will be ignored + FS Type = ext4 + FS Type = reiserfs + FS Type = jfs + FS Type = xfs + FS Type = zfs + } + File = / + } + # Things that usually have to be excluded + # You have to exclude @archivedir@ + # on your bareos server + Exclude { + File = @working_dir@ + File = @archivedir@ + File = /proc + File = /tmp + File = /var/tmp + File = /.journal + File = /.fsck + } +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/fileset/SelfTest.conf b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/fileset/SelfTest.conf new file mode 100644 index 00000000000..a117233f531 --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/fileset/SelfTest.conf @@ -0,0 +1,11 @@ +FileSet { + Name = "SelfTest" + Description = "fileset just to backup some files for selftest" + Include { + Options { + Signature = MD5 # calculate md5 checksum per file + } + #File = "/usr/local/sbin" + File= + RunBeforeJob = "@scriptdir@/make_catalog_backup.pl MyCatalog" + + # This deletes the copy of the catalog + RunAfterJob = "@scriptdir@/delete_catalog_backup" + + # This sends the bootstrap via mail for disaster recovery. + # Should be sent to another system, please change recipient accordingly + Write Bootstrap = "|@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \" -s \"Bootstrap for Job %j\" @job_email@" # (#01) + Priority = 11 # run after main backup +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in new file mode 100644 index 00000000000..577f6f9b6bb --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in @@ -0,0 +1,11 @@ +Job { + Name = "RestoreFiles" + Description = "Standard Restore template. Only one such job is needed for all standard Jobs/Clients/Storage ..." + Type = Restore + Client = bareos-fd + FileSet = "LinuxAll" + Storage = File + Pool = Incremental + Messages = Standard + Where = @tmp@/bareos-restores +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in new file mode 100644 index 00000000000..ca1891f9620 --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in @@ -0,0 +1,5 @@ +Job { + Name = "backup-bareos-fd" + JobDefs = "DefaultJob" + Client = "bareos-fd" +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in new file mode 100644 index 00000000000..0d1c0bd04e7 --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in @@ -0,0 +1,16 @@ +JobDefs { + Name = "DefaultJob" + Type = Backup + Level = Incremental + Client = bareos-fd + FileSet = "SelfTest" # selftest fileset (#13) + Schedule = "WeeklyCycle" + Storage = File + Messages = Standard + Pool = Incremental + Priority = 10 + Write Bootstrap = "@working_dir@/%c.bsr" + Full Backup Pool = Full # write Full Backups into "Full" Pool (#05) + Differential Backup Pool = Differential # write Diff Backups into "Differential" Pool (#08) + Incremental Backup Pool = Incremental # write Incr Backups into "Incremental" Pool (#11) +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/messages/Daemon.conf.in b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/messages/Daemon.conf.in new file mode 100644 index 00000000000..ce0e5ec6778 --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/messages/Daemon.conf.in @@ -0,0 +1,9 @@ +Messages { + Name = Daemon + Description = "Message delivery for daemon messages (no job)." + mailcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos daemon message\" %r" + mail = @job_email@ = all, !skipped, !audit # (#02) + console = all, !skipped, !saved, !audit + append = "@logdir@/bareos.log" = all, !skipped, !audit + append = "@logdir@/bareos-audit.log" = audit +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/messages/Standard.conf.in b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/messages/Standard.conf.in new file mode 100644 index 00000000000..fdcc1f735e5 --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/messages/Standard.conf.in @@ -0,0 +1,11 @@ +Messages { + Name = Standard + Description = "Reasonable message delivery -- send most everything to email address and to the console." + operatorcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos: Intervention needed for %j\" %r" + mailcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos: %t %e of %c %l\" %r" + operator = @job_email@ = mount # (#03) + mail = @job_email@ = all, !skipped, !saved, !audit # (#02) + console = all, !skipped, !saved, !audit + append = "@logdir@/bareos.log" = all, !skipped, !saved, !audit + catalog = all, !skipped, !saved, !audit +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/pool/Differential.conf b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/pool/Differential.conf new file mode 100644 index 00000000000..25ce24821ab --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/pool/Differential.conf @@ -0,0 +1,10 @@ +Pool { + Name = Differential + Pool Type = Backup + Recycle = yes # Bareos can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 90 days # How long should the Differential Backups be kept? (#09) + Maximum Volume Bytes = 10G # Limit Volume size to something reasonable + Maximum Volumes = 100 # Limit number of Volumes in Pool + Label Format = "Differential-" # Volumes will be labeled "Differential-" +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/pool/Full.conf b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/pool/Full.conf new file mode 100644 index 00000000000..867fc66b483 --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/pool/Full.conf @@ -0,0 +1,10 @@ +Pool { + Name = Full + Pool Type = Backup + Recycle = yes # Bareos can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 365 days # How long should the Full Backups be kept? (#06) + Maximum Volume Bytes = 50G # Limit Volume size to something reasonable + Maximum Volumes = 100 # Limit number of Volumes in Pool + Label Format = "Full-" # Volumes will be labeled "Full-" +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/pool/Incremental.conf b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/pool/Incremental.conf new file mode 100644 index 00000000000..f4dbbab6650 --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/pool/Incremental.conf @@ -0,0 +1,10 @@ +Pool { + Name = Incremental + Pool Type = Backup + Recycle = yes # Bareos can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 30 days # How long should the Incremental Backups be kept? (#12) + Maximum Volume Bytes = 1G # Limit Volume size to something reasonable + Maximum Volumes = 100 # Limit number of Volumes in Pool + Label Format = "Incremental-" # Volumes will be labeled "Incremental-" +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/pool/Scratch.conf b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/pool/Scratch.conf new file mode 100644 index 00000000000..3a489b19871 --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/pool/Scratch.conf @@ -0,0 +1,4 @@ +Pool { + Name = Scratch + Pool Type = Scratch +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/profile/operator.conf b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/profile/operator.conf new file mode 100644 index 00000000000..6edd0166dca --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/profile/operator.conf @@ -0,0 +1,18 @@ +Profile { + Name = operator + Description = "Profile allowing normal Bareos operations." + + Command ACL = !.bvfs_clear_cache, !.exit, !.sql + Command ACL = !configure, !create, !delete, !purge, !prune, !sqlquery, !umount, !unmount + Command ACL = *all* + + Catalog ACL = *all* + Client ACL = *all* + FileSet ACL = *all* + Job ACL = *all* + Plugin Options ACL = *all* + Pool ACL = *all* + Schedule ACL = *all* + Storage ACL = *all* + Where ACL = *all* +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/profile/webui-admin.conf b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/profile/webui-admin.conf new file mode 100644 index 00000000000..860af09e4fa --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/profile/webui-admin.conf @@ -0,0 +1,15 @@ +# +# bareos-webui webui-admin profile resource +# +Profile { + Name = "webui-admin" + CommandACL = !.bvfs_clear_cache, !.exit, !.sql, !configure, !create, !delete, !purge, !prune, !sqlquery, !umount, !unmount, *all* + Job ACL = *all* + Schedule ACL = *all* + Catalog ACL = *all* + Pool ACL = *all* + Storage ACL = *all* + Client ACL = *all* + FileSet ACL = *all* + Where ACL = *all* +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/profile/webui-readonly.conf b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/profile/webui-readonly.conf new file mode 100644 index 00000000000..fde80e8d4c0 --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/profile/webui-readonly.conf @@ -0,0 +1,37 @@ +# +# bareos-webui profile resource: read-only access +# + +Profile { + Name = "webui-readonly" + + # Allow access to the following commands + CommandACL = .api, .help, use, version, status + CommandACL = list, llist + CommandACL = .clients, .jobs, .filesets, .pools, .storages, .defaults, .schedule + CommandACL = .bvfs_lsdirs, .bvfs_lsfiles, .bvfs_update, .bvfs_get_jobids, .bvfs_versions, .bvfs_restore + + # Allow access to the following job resources + Job ACL = *all* + + # Allow access to the following schedule resources + Schedule ACL = *all* + + # Allow access to the following catalog resources + Catalog ACL = *all* + + # Allow access to the following pool resources + Pool ACL = *all* + + # Allow access to the following storage resources + Storage ACL = *all* + + # Allow access to the following client resources + Client ACL = *all* + + # Allow access to the following filset resources + FileSet ACL = *all* + + # Allow access to restore to any filesystem location + Where ACL = *all* +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf new file mode 100644 index 00000000000..a2181c7db3d --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf @@ -0,0 +1,6 @@ +Schedule { + Name = "WeeklyCycle" +# Run = Full 1st sat at 21:00 # (#04) +# Run = Differential 2nd-5th sat at 21:00 # (#07) +# Run = Incremental mon-fri at 21:00 # (#10) +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf new file mode 100644 index 00000000000..49b245671cb --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf @@ -0,0 +1,5 @@ +Schedule { + Name = "WeeklyCycleAfterBackup" + Description = "This schedule does the catalog. It starts after the WeeklyCycle." +# Run = Full mon-fri at 21:10 +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/storage/File.conf.in b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/storage/File.conf.in new file mode 100644 index 00000000000..4058ddc7edc --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-dir.d/storage/File.conf.in @@ -0,0 +1,8 @@ +Storage { + Name = File + Address = @hostname@ # N.B. Use a fully qualified name here (do not use "localhost" here). + Password = "@sd_password@" + Device = FileStorage + Media Type = File + SD Port = @sd_port@ +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-fd.d/client/myself.conf.in b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-fd.d/client/myself.conf.in new file mode 100644 index 00000000000..e218bf06514 --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-fd.d/client/myself.conf.in @@ -0,0 +1,20 @@ +Client { + Name = @basename@-fd + Maximum Concurrent Jobs = 20 + + # remove comment from "Plugin Directory" to load plugins from specified directory. + # if "Plugin Names" is defined, only the specified plugins will be loaded, + # otherwise all filedaemon plugins (*-fd.so) from the "Plugin Directory". + # + # Plugin Directory = "@python_plugin_module_src_fd@" + # Plugin Names = "" + + # if compatible is set to yes, we are compatible with bacula + # if set to no, new bareos features are enabled which is the default + # compatible = yes + + Working Directory = "@working_dir@" + Pid Directory = "@piddir@" + FD Port = @fd_port@ + +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in new file mode 100644 index 00000000000..c8dc7085a45 --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in @@ -0,0 +1,5 @@ +Director { + Name = bareos-dir + Password = "@fd_password@" + Description = "Allow the configured Director to access this file daemon." +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in new file mode 100644 index 00000000000..630c3a9abd3 --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in @@ -0,0 +1,6 @@ +Director { + Name = bareos-mon + Password = "@mon_fd_password@" + Monitor = yes + Description = "Restricted Director, used by tray-monitor to get the status of this file daemon." +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-fd.d/messages/Standard.conf b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-fd.d/messages/Standard.conf new file mode 100644 index 00000000000..97788e00573 --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-fd.d/messages/Standard.conf @@ -0,0 +1,5 @@ +Messages { + Name = Standard + Director = bareos-dir = all, !skipped, !restored + Description = "Send relevant messages to the Director." +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-sd.d/device/FileStorage.conf.in b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-sd.d/device/FileStorage.conf.in new file mode 100644 index 00000000000..d7f2d1dcf19 --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-sd.d/device/FileStorage.conf.in @@ -0,0 +1,11 @@ +Device { + Name = FileStorage + Media Type = File + Archive Device = @archivedir@ + LabelMedia = yes; # lets Bareos label unlabeled media + Random Access = yes; + AutomaticMount = yes; # when device opened, read it + RemovableMedia = no; + AlwaysOpen = no; + Description = "File device. A connecting Director must have the same Name and MediaType." +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in new file mode 100644 index 00000000000..deef3360c2d --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in @@ -0,0 +1,5 @@ +Director { + Name = bareos-dir + Password = "@sd_password@" + Description = "Director, who is permitted to contact this storage daemon." +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in new file mode 100644 index 00000000000..e3cfdee6315 --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in @@ -0,0 +1,6 @@ +Director { + Name = bareos-mon + Password = "@mon_sd_password@" + Monitor = yes + Description = "Restricted Director, used by tray-monitor to get the status of this storage daemon." +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-sd.d/messages/Standard.conf b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-sd.d/messages/Standard.conf new file mode 100644 index 00000000000..468348e62fc --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-sd.d/messages/Standard.conf @@ -0,0 +1,5 @@ +Messages { + Name = Standard + Director = bareos-dir = all + Description = "Send all messages to the Director." +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in new file mode 100644 index 00000000000..3e1723fa60c --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in @@ -0,0 +1,14 @@ +Storage { + Name = bareos-sd + Maximum Concurrent Jobs = 20 + + # remove comment from "Plugin Directory" to load plugins from specified directory. + # if "Plugin Names" is defined, only the specified plugins will be loaded, + # otherwise all storage plugins (*-sd.so) from the "Plugin Directory". + # + # Plugin Directory = "@python_plugin_module_src_sd@" + # Plugin Names = "" + Working Directory = "@working_dir@" + Pid Directory = "@piddir@" + SD Port = @sd_port@ +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/bconsole.conf.in b/systemtests/tests/webui-admin-restore/etc/bareos/bconsole.conf.in new file mode 100644 index 00000000000..ecb6ad00dce --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/bconsole.conf.in @@ -0,0 +1,10 @@ +# +# Bareos User Agent (or Console) Configuration File +# + +Director { + Name = @basename@-dir + DIRport = @dir_port@ + address = @hostname@ + Password = "@dir_password@" +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in b/systemtests/tests/webui-admin-restore/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in new file mode 100644 index 00000000000..dd00dd9f103 --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in @@ -0,0 +1,5 @@ +Client { + Name = @basename@-fd + Address = localhost + Password = "@mon_fd_password@" # password for FileDaemon +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/tray-monitor.d/director/Director-local.conf.in b/systemtests/tests/webui-admin-restore/etc/bareos/tray-monitor.d/director/Director-local.conf.in new file mode 100644 index 00000000000..55dae492250 --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/tray-monitor.d/director/Director-local.conf.in @@ -0,0 +1,4 @@ +Director { + Name = bareos-dir + Address = localhost +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in b/systemtests/tests/webui-admin-restore/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in new file mode 100644 index 00000000000..cddfa253945 --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in @@ -0,0 +1,7 @@ +Monitor { + # Name to establish connections to Director Console, Storage Daemon and File Daemon. + Name = bareos-mon + # Password to access the Director + Password = "@mon_dir_password@" # password for the Directors + RefreshInterval = 30 seconds +} diff --git a/systemtests/tests/webui-admin-restore/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in b/systemtests/tests/webui-admin-restore/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in new file mode 100644 index 00000000000..6538f4fd248 --- /dev/null +++ b/systemtests/tests/webui-admin-restore/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in @@ -0,0 +1,5 @@ +Storage { + Name = bareos-sd + Address = localhost + Password = "@mon_sd_password@" # password for StorageDaemon +} diff --git a/systemtests/tests/webui-admin-restore/testrunner.in b/systemtests/tests/webui-admin-restore/testrunner.in new file mode 100755 index 00000000000..e3336da1acc --- /dev/null +++ b/systemtests/tests/webui-admin-restore/testrunner.in @@ -0,0 +1,60 @@ +#!/bin/sh +# +# Run a simple backup +# then restore it. +# +TestName="$(basename "$(pwd)")" +export TestName + +JobName=backup-bareos-fd +. ./environment +. ${scripts}/functions + +${scripts}/cleanup +${scripts}/setup + + +# Directory to backup. +# This directory will be created by setup_data(). +BackupDirectory="${tmp}/data" + +# Use a tgz to setup data to be backed up. +# Data will be placed at "${tmp}/data/". +setup_data + +start_test + +cat <$tmp/bconcmds +@$out /dev/null +messages +@$out $tmp/log1.out +run job=$JobName yes +wait +messages +quit +END_OF_DATA + +run_bareos + +@PHP@ -S 127.0.0.1:@php_port@ -t @PROJECT_SOURCE_DIR@/../webui/public/ >"$tmp/php.out" 2>&1 & + +PHP_PID=$(echo $!) + +# run tests but stop the test run on the first error or failure + +# +# test with admin profile resource +# +export BAREOS_WEBUI_PROFILE=admin +export BAREOS_WEBUI_TESTNAME=test_restore +echo "test with admin profile:" >"$tmp/selenium.out" 2>&1 +@PYTHON@ @CMAKE_SOURCE_DIR@/webui/tests/selenium/webui-selenium-test.py -v SeleniumTest.test_restore >>"$tmp/selenium.out" 2>&1 + +estat=$? +export estat + +kill "${PHP_PID}" + +stop_bareos + +end_test diff --git a/systemtests/tests/webui-admin-run-custom-job/directors.ini.in b/systemtests/tests/webui-admin-run-custom-job/directors.ini.in new file mode 100644 index 00000000000..054b346838c --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/directors.ini.in @@ -0,0 +1,81 @@ +; +; Bareos WebUI Configuration File +; +; File: /usr/local/etc/bareos-webui/directors.ini +; + +;------------------------------------------------------------------------------ +; Section localhost-dir +;------------------------------------------------------------------------------ +[localhost-dir] + +; Enable or disable section. Possible values are "yes" or "no", the default is "yes". +enabled = "yes" + +; Fill in the IP-Address or FQDN of you director. +diraddress = "localhost" + +; Default value is 9101 +dirport = @dir_port@ + +; Set catalog to explicit value if you have multiple catalogs +;catalog = "MyCatalog" + +; Set the console name and password for a dedicated pam console; +; the counterpart console-config in the director must have set +; UsePamAuthentication = yes +;pam_console_name = "admin" +;pam_console_password = "admin" + +; TLS verify peer +; Possible values: true or false +tls_verify_peer = false + +; Server can do TLS +; Possible values: true or false +server_can_do_tls = false + +; Server requires TLS +; Possible values: true or false +server_requires_tls = false + +; Client can do TLS +; Possible values: true or false +client_can_do_tls = false + +; Client requires TLS +; Possible value: true or false +client_requires_tls = false + +; Path to the certificate authority file +; E.g. ca_file = "/usr/local/etc/bareos/tls/BareosCA.crt" +;ca_file = "" + +; Path to the cert file which needs to contain the client certificate and the key in PEM encoding +; E.g. ca_file = "/usr/local/etc/bareos/tls/restricted-named-console.pem" +;cert_file = "" + +; Passphrase needed to unlock the above cert file if set +;cert_file_passphrase = "" + +; Allowed common names +; E.g. allowed_cns = "host1.example.com" +;allowed_cns = "" + +;------------------------------------------------------------------------------ +; Section another-host-dir +;------------------------------------------------------------------------------ +[another-host-dir] +enabled = "no" +diraddress = "192.168.120.1" +dirport = 9101 +;catalog = "MyCatalog" +;tls_verify_peer = false +;server_can_do_tls = false +;server_requires_tls = false +;client_can_do_tls = false +;client_requires_tls = false +;ca_file = "" +;cert_file = "" +;cert_file_passphrase = "" +;allowed_cns = "" diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in new file mode 100644 index 00000000000..479bc6fecbb --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in @@ -0,0 +1,8 @@ +Catalog { + Name = MyCatalog + #dbdriver = "@DEFAULT_DB_TYPE@" + dbdriver = "XXX_REPLACE_WITH_DATABASE_DRIVER_XXX" + dbname = "@db_name@" + dbuser = "@db_user@" + dbpassword = "@db_password@" +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in new file mode 100644 index 00000000000..470ca702035 --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in @@ -0,0 +1,7 @@ +Client { + Name = bareos-fd + Description = "Client resource of the Director itself." + Address = localhost + Password = "@fd_password@" # password for FileDaemon + FD PORT = @fd_port@ +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/console/admin.conf b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/console/admin.conf new file mode 100644 index 00000000000..fe312662e3e --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/console/admin.conf @@ -0,0 +1,17 @@ +# +# Restricted console used by bareos-webui +# +Console { + Name = admin + Password = "admin" + Profile = "webui-admin" + + + # As php does not support TLS-PSK, + # and the director has TLS enabled by default, + # we need to either disable TLS or setup + # TLS with certificates. + # + # For testing purposes we disable it here + TLS Enable = No +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in new file mode 100644 index 00000000000..d276adcb87d --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in @@ -0,0 +1,7 @@ +Console { + Name = bareos-mon + Description = "Restricted console used by tray-monitor to get the status of the director." + Password = "@mon_dir_password@" + CommandACL = status, .status + JobACL = *all* +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/console/readonly.conf b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/console/readonly.conf new file mode 100644 index 00000000000..0ff95010efd --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/console/readonly.conf @@ -0,0 +1,17 @@ +# +# Restricted console used by bareos-webui +# +Console { + Name = readonly + Password = "readonly" + Profile = "webui-readonly" + + + # As php does not support TLS-PSK, + # and the director has TLS enabled by default, + # we need to either disable TLS or setup + # TLS with certificates. + # + # For testing purposes we disable it here + TLS Enable = No +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in new file mode 100644 index 00000000000..33b3a426e3a --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in @@ -0,0 +1,27 @@ +Director { # define myself + Name = bareos-dir + QueryFile = "@scriptdir@/query.sql" + Maximum Concurrent Jobs = 10 + Password = "@dir_password@" # Console password + Messages = Daemon + Auditing = yes + + # Enable the Heartbeat if you experience connection losses + # (eg. because of your router or firewall configuration). + # Additionally the Heartbeat can be enabled in bareos-sd and bareos-fd. + # + # Heartbeat Interval = 1 min + + # remove comment in next line to load dynamic backends from specified directory + Backend Directory = @backenddir@ + + # remove comment from "Plugin Directory" to load plugins from specified directory. + # if "Plugin Names" is defined, only the specified plugins will be loaded, + # otherwise all director plugins (*-dir.so) from the "Plugin Directory". + # + # Plugin Directory = "@python_plugin_module_src_dir@" + # Plugin Names = "" + Working Directory = "@working_dir@" + Pid Directory = "@piddir@" + DirPort = @dir_port@ +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf new file mode 100644 index 00000000000..ec1a47c971b --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf @@ -0,0 +1,11 @@ +FileSet { + Name = "Catalog" + Description = "Backup the catalog dump and Bareos configuration files." + Include { + Options { + signature = MD5 + } + File = "/var/lib/bareos/bareos.sql" # database dump + File = "/usr/local/etc/bareos" # configuration + } +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in new file mode 100644 index 00000000000..c7cdc433fe1 --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in @@ -0,0 +1,11 @@ +FileSet { + Name = "Catalog" + Description = "Backup the catalog dump and Bareos configuration files." + Include { + Options { + signature = MD5 + } + File = "@working_dir@/@db_name@.sql" # database dump + File = "@confdir@" # configuration + } +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf new file mode 100644 index 00000000000..3a3336823ac --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf @@ -0,0 +1,31 @@ +FileSet { + Name = "LinuxAll" + Description = "Backup all regular filesystems, determined by filesystem type." + Include { + Options { + Signature = MD5 # calculate md5 checksum per file + One FS = No # change into other filessytems + FS Type = btrfs + FS Type = ext2 # filesystems of given types will be backed up + FS Type = ext3 # others will be ignored + FS Type = ext4 + FS Type = reiserfs + FS Type = jfs + FS Type = xfs + FS Type = zfs + } + File = / + } + # Things that usually have to be excluded + # You have to exclude /var/lib/bareos/storage + # on your bareos server + Exclude { + File = /var/lib/bareos + File = /var/lib/bareos/storage + File = /proc + File = /tmp + File = /var/tmp + File = /.journal + File = /.fsck + } +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in new file mode 100644 index 00000000000..cee45dfa3ed --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in @@ -0,0 +1,31 @@ +FileSet { + Name = "LinuxAll" + Description = "Backup all regular filesystems, determined by filesystem type." + Include { + Options { + Signature = MD5 # calculate md5 checksum per file + One FS = No # change into other filessytems + FS Type = btrfs + FS Type = ext2 # filesystems of given types will be backed up + FS Type = ext3 # others will be ignored + FS Type = ext4 + FS Type = reiserfs + FS Type = jfs + FS Type = xfs + FS Type = zfs + } + File = / + } + # Things that usually have to be excluded + # You have to exclude @archivedir@ + # on your bareos server + Exclude { + File = @working_dir@ + File = @archivedir@ + File = /proc + File = /tmp + File = /var/tmp + File = /.journal + File = /.fsck + } +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/fileset/SelfTest.conf b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/fileset/SelfTest.conf new file mode 100644 index 00000000000..a117233f531 --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/fileset/SelfTest.conf @@ -0,0 +1,11 @@ +FileSet { + Name = "SelfTest" + Description = "fileset just to backup some files for selftest" + Include { + Options { + Signature = MD5 # calculate md5 checksum per file + } + #File = "/usr/local/sbin" + File= + RunBeforeJob = "@scriptdir@/make_catalog_backup.pl MyCatalog" + + # This deletes the copy of the catalog + RunAfterJob = "@scriptdir@/delete_catalog_backup" + + # This sends the bootstrap via mail for disaster recovery. + # Should be sent to another system, please change recipient accordingly + Write Bootstrap = "|@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \" -s \"Bootstrap for Job %j\" @job_email@" # (#01) + Priority = 11 # run after main backup +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in new file mode 100644 index 00000000000..577f6f9b6bb --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in @@ -0,0 +1,11 @@ +Job { + Name = "RestoreFiles" + Description = "Standard Restore template. Only one such job is needed for all standard Jobs/Clients/Storage ..." + Type = Restore + Client = bareos-fd + FileSet = "LinuxAll" + Storage = File + Pool = Incremental + Messages = Standard + Where = @tmp@/bareos-restores +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in new file mode 100644 index 00000000000..ca1891f9620 --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in @@ -0,0 +1,5 @@ +Job { + Name = "backup-bareos-fd" + JobDefs = "DefaultJob" + Client = "bareos-fd" +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in new file mode 100644 index 00000000000..0d1c0bd04e7 --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in @@ -0,0 +1,16 @@ +JobDefs { + Name = "DefaultJob" + Type = Backup + Level = Incremental + Client = bareos-fd + FileSet = "SelfTest" # selftest fileset (#13) + Schedule = "WeeklyCycle" + Storage = File + Messages = Standard + Pool = Incremental + Priority = 10 + Write Bootstrap = "@working_dir@/%c.bsr" + Full Backup Pool = Full # write Full Backups into "Full" Pool (#05) + Differential Backup Pool = Differential # write Diff Backups into "Differential" Pool (#08) + Incremental Backup Pool = Incremental # write Incr Backups into "Incremental" Pool (#11) +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/messages/Daemon.conf.in b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/messages/Daemon.conf.in new file mode 100644 index 00000000000..ce0e5ec6778 --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/messages/Daemon.conf.in @@ -0,0 +1,9 @@ +Messages { + Name = Daemon + Description = "Message delivery for daemon messages (no job)." + mailcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos daemon message\" %r" + mail = @job_email@ = all, !skipped, !audit # (#02) + console = all, !skipped, !saved, !audit + append = "@logdir@/bareos.log" = all, !skipped, !audit + append = "@logdir@/bareos-audit.log" = audit +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/messages/Standard.conf.in b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/messages/Standard.conf.in new file mode 100644 index 00000000000..fdcc1f735e5 --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/messages/Standard.conf.in @@ -0,0 +1,11 @@ +Messages { + Name = Standard + Description = "Reasonable message delivery -- send most everything to email address and to the console." + operatorcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos: Intervention needed for %j\" %r" + mailcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos: %t %e of %c %l\" %r" + operator = @job_email@ = mount # (#03) + mail = @job_email@ = all, !skipped, !saved, !audit # (#02) + console = all, !skipped, !saved, !audit + append = "@logdir@/bareos.log" = all, !skipped, !saved, !audit + catalog = all, !skipped, !saved, !audit +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/pool/Differential.conf b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/pool/Differential.conf new file mode 100644 index 00000000000..25ce24821ab --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/pool/Differential.conf @@ -0,0 +1,10 @@ +Pool { + Name = Differential + Pool Type = Backup + Recycle = yes # Bareos can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 90 days # How long should the Differential Backups be kept? (#09) + Maximum Volume Bytes = 10G # Limit Volume size to something reasonable + Maximum Volumes = 100 # Limit number of Volumes in Pool + Label Format = "Differential-" # Volumes will be labeled "Differential-" +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/pool/Full.conf b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/pool/Full.conf new file mode 100644 index 00000000000..867fc66b483 --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/pool/Full.conf @@ -0,0 +1,10 @@ +Pool { + Name = Full + Pool Type = Backup + Recycle = yes # Bareos can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 365 days # How long should the Full Backups be kept? (#06) + Maximum Volume Bytes = 50G # Limit Volume size to something reasonable + Maximum Volumes = 100 # Limit number of Volumes in Pool + Label Format = "Full-" # Volumes will be labeled "Full-" +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/pool/Incremental.conf b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/pool/Incremental.conf new file mode 100644 index 00000000000..f4dbbab6650 --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/pool/Incremental.conf @@ -0,0 +1,10 @@ +Pool { + Name = Incremental + Pool Type = Backup + Recycle = yes # Bareos can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 30 days # How long should the Incremental Backups be kept? (#12) + Maximum Volume Bytes = 1G # Limit Volume size to something reasonable + Maximum Volumes = 100 # Limit number of Volumes in Pool + Label Format = "Incremental-" # Volumes will be labeled "Incremental-" +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/pool/Scratch.conf b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/pool/Scratch.conf new file mode 100644 index 00000000000..3a489b19871 --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/pool/Scratch.conf @@ -0,0 +1,4 @@ +Pool { + Name = Scratch + Pool Type = Scratch +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/profile/operator.conf b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/profile/operator.conf new file mode 100644 index 00000000000..6edd0166dca --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/profile/operator.conf @@ -0,0 +1,18 @@ +Profile { + Name = operator + Description = "Profile allowing normal Bareos operations." + + Command ACL = !.bvfs_clear_cache, !.exit, !.sql + Command ACL = !configure, !create, !delete, !purge, !prune, !sqlquery, !umount, !unmount + Command ACL = *all* + + Catalog ACL = *all* + Client ACL = *all* + FileSet ACL = *all* + Job ACL = *all* + Plugin Options ACL = *all* + Pool ACL = *all* + Schedule ACL = *all* + Storage ACL = *all* + Where ACL = *all* +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/profile/webui-admin.conf b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/profile/webui-admin.conf new file mode 100644 index 00000000000..860af09e4fa --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/profile/webui-admin.conf @@ -0,0 +1,15 @@ +# +# bareos-webui webui-admin profile resource +# +Profile { + Name = "webui-admin" + CommandACL = !.bvfs_clear_cache, !.exit, !.sql, !configure, !create, !delete, !purge, !prune, !sqlquery, !umount, !unmount, *all* + Job ACL = *all* + Schedule ACL = *all* + Catalog ACL = *all* + Pool ACL = *all* + Storage ACL = *all* + Client ACL = *all* + FileSet ACL = *all* + Where ACL = *all* +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/profile/webui-readonly.conf b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/profile/webui-readonly.conf new file mode 100644 index 00000000000..fde80e8d4c0 --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/profile/webui-readonly.conf @@ -0,0 +1,37 @@ +# +# bareos-webui profile resource: read-only access +# + +Profile { + Name = "webui-readonly" + + # Allow access to the following commands + CommandACL = .api, .help, use, version, status + CommandACL = list, llist + CommandACL = .clients, .jobs, .filesets, .pools, .storages, .defaults, .schedule + CommandACL = .bvfs_lsdirs, .bvfs_lsfiles, .bvfs_update, .bvfs_get_jobids, .bvfs_versions, .bvfs_restore + + # Allow access to the following job resources + Job ACL = *all* + + # Allow access to the following schedule resources + Schedule ACL = *all* + + # Allow access to the following catalog resources + Catalog ACL = *all* + + # Allow access to the following pool resources + Pool ACL = *all* + + # Allow access to the following storage resources + Storage ACL = *all* + + # Allow access to the following client resources + Client ACL = *all* + + # Allow access to the following filset resources + FileSet ACL = *all* + + # Allow access to restore to any filesystem location + Where ACL = *all* +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf new file mode 100644 index 00000000000..a2181c7db3d --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf @@ -0,0 +1,6 @@ +Schedule { + Name = "WeeklyCycle" +# Run = Full 1st sat at 21:00 # (#04) +# Run = Differential 2nd-5th sat at 21:00 # (#07) +# Run = Incremental mon-fri at 21:00 # (#10) +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf new file mode 100644 index 00000000000..49b245671cb --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf @@ -0,0 +1,5 @@ +Schedule { + Name = "WeeklyCycleAfterBackup" + Description = "This schedule does the catalog. It starts after the WeeklyCycle." +# Run = Full mon-fri at 21:10 +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/storage/File.conf.in b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/storage/File.conf.in new file mode 100644 index 00000000000..4058ddc7edc --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-dir.d/storage/File.conf.in @@ -0,0 +1,8 @@ +Storage { + Name = File + Address = @hostname@ # N.B. Use a fully qualified name here (do not use "localhost" here). + Password = "@sd_password@" + Device = FileStorage + Media Type = File + SD Port = @sd_port@ +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-fd.d/client/myself.conf.in b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-fd.d/client/myself.conf.in new file mode 100644 index 00000000000..e218bf06514 --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-fd.d/client/myself.conf.in @@ -0,0 +1,20 @@ +Client { + Name = @basename@-fd + Maximum Concurrent Jobs = 20 + + # remove comment from "Plugin Directory" to load plugins from specified directory. + # if "Plugin Names" is defined, only the specified plugins will be loaded, + # otherwise all filedaemon plugins (*-fd.so) from the "Plugin Directory". + # + # Plugin Directory = "@python_plugin_module_src_fd@" + # Plugin Names = "" + + # if compatible is set to yes, we are compatible with bacula + # if set to no, new bareos features are enabled which is the default + # compatible = yes + + Working Directory = "@working_dir@" + Pid Directory = "@piddir@" + FD Port = @fd_port@ + +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in new file mode 100644 index 00000000000..c8dc7085a45 --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in @@ -0,0 +1,5 @@ +Director { + Name = bareos-dir + Password = "@fd_password@" + Description = "Allow the configured Director to access this file daemon." +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in new file mode 100644 index 00000000000..630c3a9abd3 --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in @@ -0,0 +1,6 @@ +Director { + Name = bareos-mon + Password = "@mon_fd_password@" + Monitor = yes + Description = "Restricted Director, used by tray-monitor to get the status of this file daemon." +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-fd.d/messages/Standard.conf b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-fd.d/messages/Standard.conf new file mode 100644 index 00000000000..97788e00573 --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-fd.d/messages/Standard.conf @@ -0,0 +1,5 @@ +Messages { + Name = Standard + Director = bareos-dir = all, !skipped, !restored + Description = "Send relevant messages to the Director." +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-sd.d/device/FileStorage.conf.in b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-sd.d/device/FileStorage.conf.in new file mode 100644 index 00000000000..d7f2d1dcf19 --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-sd.d/device/FileStorage.conf.in @@ -0,0 +1,11 @@ +Device { + Name = FileStorage + Media Type = File + Archive Device = @archivedir@ + LabelMedia = yes; # lets Bareos label unlabeled media + Random Access = yes; + AutomaticMount = yes; # when device opened, read it + RemovableMedia = no; + AlwaysOpen = no; + Description = "File device. A connecting Director must have the same Name and MediaType." +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in new file mode 100644 index 00000000000..deef3360c2d --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in @@ -0,0 +1,5 @@ +Director { + Name = bareos-dir + Password = "@sd_password@" + Description = "Director, who is permitted to contact this storage daemon." +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in new file mode 100644 index 00000000000..e3cfdee6315 --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in @@ -0,0 +1,6 @@ +Director { + Name = bareos-mon + Password = "@mon_sd_password@" + Monitor = yes + Description = "Restricted Director, used by tray-monitor to get the status of this storage daemon." +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-sd.d/messages/Standard.conf b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-sd.d/messages/Standard.conf new file mode 100644 index 00000000000..468348e62fc --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-sd.d/messages/Standard.conf @@ -0,0 +1,5 @@ +Messages { + Name = Standard + Director = bareos-dir = all + Description = "Send all messages to the Director." +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in new file mode 100644 index 00000000000..3e1723fa60c --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in @@ -0,0 +1,14 @@ +Storage { + Name = bareos-sd + Maximum Concurrent Jobs = 20 + + # remove comment from "Plugin Directory" to load plugins from specified directory. + # if "Plugin Names" is defined, only the specified plugins will be loaded, + # otherwise all storage plugins (*-sd.so) from the "Plugin Directory". + # + # Plugin Directory = "@python_plugin_module_src_sd@" + # Plugin Names = "" + Working Directory = "@working_dir@" + Pid Directory = "@piddir@" + SD Port = @sd_port@ +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bconsole.conf.in b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bconsole.conf.in new file mode 100644 index 00000000000..ecb6ad00dce --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/bconsole.conf.in @@ -0,0 +1,10 @@ +# +# Bareos User Agent (or Console) Configuration File +# + +Director { + Name = @basename@-dir + DIRport = @dir_port@ + address = @hostname@ + Password = "@dir_password@" +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in new file mode 100644 index 00000000000..dd00dd9f103 --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in @@ -0,0 +1,5 @@ +Client { + Name = @basename@-fd + Address = localhost + Password = "@mon_fd_password@" # password for FileDaemon +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/tray-monitor.d/director/Director-local.conf.in b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/tray-monitor.d/director/Director-local.conf.in new file mode 100644 index 00000000000..55dae492250 --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/tray-monitor.d/director/Director-local.conf.in @@ -0,0 +1,4 @@ +Director { + Name = bareos-dir + Address = localhost +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in new file mode 100644 index 00000000000..cddfa253945 --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in @@ -0,0 +1,7 @@ +Monitor { + # Name to establish connections to Director Console, Storage Daemon and File Daemon. + Name = bareos-mon + # Password to access the Director + Password = "@mon_dir_password@" # password for the Directors + RefreshInterval = 30 seconds +} diff --git a/systemtests/tests/webui-admin-run-custom-job/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in new file mode 100644 index 00000000000..6538f4fd248 --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in @@ -0,0 +1,5 @@ +Storage { + Name = bareos-sd + Address = localhost + Password = "@mon_sd_password@" # password for StorageDaemon +} diff --git a/systemtests/tests/webui-admin-run-custom-job/testrunner.in b/systemtests/tests/webui-admin-run-custom-job/testrunner.in new file mode 100755 index 00000000000..764e17add48 --- /dev/null +++ b/systemtests/tests/webui-admin-run-custom-job/testrunner.in @@ -0,0 +1,60 @@ +#!/bin/sh +# +# Run a simple backup +# then restore it. +# +TestName="$(basename "$(pwd)")" +export TestName + +JobName=backup-bareos-fd +. ./environment +. ${scripts}/functions + +${scripts}/cleanup +${scripts}/setup + + +# Directory to backup. +# This directory will be created by setup_data(). +BackupDirectory="${tmp}/data" + +# Use a tgz to setup data to be backed up. +# Data will be placed at "${tmp}/data/". +setup_data + +start_test + +cat <$tmp/bconcmds +@$out /dev/null +messages +@$out $tmp/log1.out +run job=$JobName yes +wait +messages +quit +END_OF_DATA + +run_bareos + +@PHP@ -S 127.0.0.1:@php_port@ -t @PROJECT_SOURCE_DIR@/../webui/public/ >"$tmp/php.out" 2>&1 & + +PHP_PID=$(echo $!) + +# run tests but stop the test run on the first error or failure + +# +# test with admin profile resource +# +export BAREOS_WEBUI_PROFILE=admin +export BAREOS_WEBUI_TESTNAME=test_run_configured_job +echo "test with admin profile:" >"$tmp/selenium.out" 2>&1 +@PYTHON@ @CMAKE_SOURCE_DIR@/webui/tests/selenium/webui-selenium-test.py -v SeleniumTest.test_run_configured_job >>"$tmp/selenium.out" 2>&1 + +estat=$? +export estat + +kill "${PHP_PID}" + +stop_bareos + +end_test diff --git a/systemtests/tests/webui-admin-run-job/directors.ini.in b/systemtests/tests/webui-admin-run-job/directors.ini.in new file mode 100644 index 00000000000..054b346838c --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/directors.ini.in @@ -0,0 +1,81 @@ +; +; Bareos WebUI Configuration File +; +; File: /usr/local/etc/bareos-webui/directors.ini +; + +;------------------------------------------------------------------------------ +; Section localhost-dir +;------------------------------------------------------------------------------ +[localhost-dir] + +; Enable or disable section. Possible values are "yes" or "no", the default is "yes". +enabled = "yes" + +; Fill in the IP-Address or FQDN of you director. +diraddress = "localhost" + +; Default value is 9101 +dirport = @dir_port@ + +; Set catalog to explicit value if you have multiple catalogs +;catalog = "MyCatalog" + +; Set the console name and password for a dedicated pam console; +; the counterpart console-config in the director must have set +; UsePamAuthentication = yes +;pam_console_name = "admin" +;pam_console_password = "admin" + +; TLS verify peer +; Possible values: true or false +tls_verify_peer = false + +; Server can do TLS +; Possible values: true or false +server_can_do_tls = false + +; Server requires TLS +; Possible values: true or false +server_requires_tls = false + +; Client can do TLS +; Possible values: true or false +client_can_do_tls = false + +; Client requires TLS +; Possible value: true or false +client_requires_tls = false + +; Path to the certificate authority file +; E.g. ca_file = "/usr/local/etc/bareos/tls/BareosCA.crt" +;ca_file = "" + +; Path to the cert file which needs to contain the client certificate and the key in PEM encoding +; E.g. ca_file = "/usr/local/etc/bareos/tls/restricted-named-console.pem" +;cert_file = "" + +; Passphrase needed to unlock the above cert file if set +;cert_file_passphrase = "" + +; Allowed common names +; E.g. allowed_cns = "host1.example.com" +;allowed_cns = "" + +;------------------------------------------------------------------------------ +; Section another-host-dir +;------------------------------------------------------------------------------ +[another-host-dir] +enabled = "no" +diraddress = "192.168.120.1" +dirport = 9101 +;catalog = "MyCatalog" +;tls_verify_peer = false +;server_can_do_tls = false +;server_requires_tls = false +;client_can_do_tls = false +;client_requires_tls = false +;ca_file = "" +;cert_file = "" +;cert_file_passphrase = "" +;allowed_cns = "" diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in new file mode 100644 index 00000000000..479bc6fecbb --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in @@ -0,0 +1,8 @@ +Catalog { + Name = MyCatalog + #dbdriver = "@DEFAULT_DB_TYPE@" + dbdriver = "XXX_REPLACE_WITH_DATABASE_DRIVER_XXX" + dbname = "@db_name@" + dbuser = "@db_user@" + dbpassword = "@db_password@" +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in new file mode 100644 index 00000000000..470ca702035 --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in @@ -0,0 +1,7 @@ +Client { + Name = bareos-fd + Description = "Client resource of the Director itself." + Address = localhost + Password = "@fd_password@" # password for FileDaemon + FD PORT = @fd_port@ +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/console/admin.conf b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/console/admin.conf new file mode 100644 index 00000000000..fe312662e3e --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/console/admin.conf @@ -0,0 +1,17 @@ +# +# Restricted console used by bareos-webui +# +Console { + Name = admin + Password = "admin" + Profile = "webui-admin" + + + # As php does not support TLS-PSK, + # and the director has TLS enabled by default, + # we need to either disable TLS or setup + # TLS with certificates. + # + # For testing purposes we disable it here + TLS Enable = No +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in new file mode 100644 index 00000000000..d276adcb87d --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in @@ -0,0 +1,7 @@ +Console { + Name = bareos-mon + Description = "Restricted console used by tray-monitor to get the status of the director." + Password = "@mon_dir_password@" + CommandACL = status, .status + JobACL = *all* +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/console/readonly.conf b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/console/readonly.conf new file mode 100644 index 00000000000..0ff95010efd --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/console/readonly.conf @@ -0,0 +1,17 @@ +# +# Restricted console used by bareos-webui +# +Console { + Name = readonly + Password = "readonly" + Profile = "webui-readonly" + + + # As php does not support TLS-PSK, + # and the director has TLS enabled by default, + # we need to either disable TLS or setup + # TLS with certificates. + # + # For testing purposes we disable it here + TLS Enable = No +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in new file mode 100644 index 00000000000..33b3a426e3a --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in @@ -0,0 +1,27 @@ +Director { # define myself + Name = bareos-dir + QueryFile = "@scriptdir@/query.sql" + Maximum Concurrent Jobs = 10 + Password = "@dir_password@" # Console password + Messages = Daemon + Auditing = yes + + # Enable the Heartbeat if you experience connection losses + # (eg. because of your router or firewall configuration). + # Additionally the Heartbeat can be enabled in bareos-sd and bareos-fd. + # + # Heartbeat Interval = 1 min + + # remove comment in next line to load dynamic backends from specified directory + Backend Directory = @backenddir@ + + # remove comment from "Plugin Directory" to load plugins from specified directory. + # if "Plugin Names" is defined, only the specified plugins will be loaded, + # otherwise all director plugins (*-dir.so) from the "Plugin Directory". + # + # Plugin Directory = "@python_plugin_module_src_dir@" + # Plugin Names = "" + Working Directory = "@working_dir@" + Pid Directory = "@piddir@" + DirPort = @dir_port@ +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf new file mode 100644 index 00000000000..ec1a47c971b --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf @@ -0,0 +1,11 @@ +FileSet { + Name = "Catalog" + Description = "Backup the catalog dump and Bareos configuration files." + Include { + Options { + signature = MD5 + } + File = "/var/lib/bareos/bareos.sql" # database dump + File = "/usr/local/etc/bareos" # configuration + } +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in new file mode 100644 index 00000000000..c7cdc433fe1 --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in @@ -0,0 +1,11 @@ +FileSet { + Name = "Catalog" + Description = "Backup the catalog dump and Bareos configuration files." + Include { + Options { + signature = MD5 + } + File = "@working_dir@/@db_name@.sql" # database dump + File = "@confdir@" # configuration + } +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf new file mode 100644 index 00000000000..3a3336823ac --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf @@ -0,0 +1,31 @@ +FileSet { + Name = "LinuxAll" + Description = "Backup all regular filesystems, determined by filesystem type." + Include { + Options { + Signature = MD5 # calculate md5 checksum per file + One FS = No # change into other filessytems + FS Type = btrfs + FS Type = ext2 # filesystems of given types will be backed up + FS Type = ext3 # others will be ignored + FS Type = ext4 + FS Type = reiserfs + FS Type = jfs + FS Type = xfs + FS Type = zfs + } + File = / + } + # Things that usually have to be excluded + # You have to exclude /var/lib/bareos/storage + # on your bareos server + Exclude { + File = /var/lib/bareos + File = /var/lib/bareos/storage + File = /proc + File = /tmp + File = /var/tmp + File = /.journal + File = /.fsck + } +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in new file mode 100644 index 00000000000..cee45dfa3ed --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in @@ -0,0 +1,31 @@ +FileSet { + Name = "LinuxAll" + Description = "Backup all regular filesystems, determined by filesystem type." + Include { + Options { + Signature = MD5 # calculate md5 checksum per file + One FS = No # change into other filessytems + FS Type = btrfs + FS Type = ext2 # filesystems of given types will be backed up + FS Type = ext3 # others will be ignored + FS Type = ext4 + FS Type = reiserfs + FS Type = jfs + FS Type = xfs + FS Type = zfs + } + File = / + } + # Things that usually have to be excluded + # You have to exclude @archivedir@ + # on your bareos server + Exclude { + File = @working_dir@ + File = @archivedir@ + File = /proc + File = /tmp + File = /var/tmp + File = /.journal + File = /.fsck + } +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/fileset/SelfTest.conf b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/fileset/SelfTest.conf new file mode 100644 index 00000000000..a117233f531 --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/fileset/SelfTest.conf @@ -0,0 +1,11 @@ +FileSet { + Name = "SelfTest" + Description = "fileset just to backup some files for selftest" + Include { + Options { + Signature = MD5 # calculate md5 checksum per file + } + #File = "/usr/local/sbin" + File= + RunBeforeJob = "@scriptdir@/make_catalog_backup.pl MyCatalog" + + # This deletes the copy of the catalog + RunAfterJob = "@scriptdir@/delete_catalog_backup" + + # This sends the bootstrap via mail for disaster recovery. + # Should be sent to another system, please change recipient accordingly + Write Bootstrap = "|@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \" -s \"Bootstrap for Job %j\" @job_email@" # (#01) + Priority = 11 # run after main backup +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in new file mode 100644 index 00000000000..577f6f9b6bb --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in @@ -0,0 +1,11 @@ +Job { + Name = "RestoreFiles" + Description = "Standard Restore template. Only one such job is needed for all standard Jobs/Clients/Storage ..." + Type = Restore + Client = bareos-fd + FileSet = "LinuxAll" + Storage = File + Pool = Incremental + Messages = Standard + Where = @tmp@/bareos-restores +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in new file mode 100644 index 00000000000..ca1891f9620 --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in @@ -0,0 +1,5 @@ +Job { + Name = "backup-bareos-fd" + JobDefs = "DefaultJob" + Client = "bareos-fd" +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in new file mode 100644 index 00000000000..0d1c0bd04e7 --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in @@ -0,0 +1,16 @@ +JobDefs { + Name = "DefaultJob" + Type = Backup + Level = Incremental + Client = bareos-fd + FileSet = "SelfTest" # selftest fileset (#13) + Schedule = "WeeklyCycle" + Storage = File + Messages = Standard + Pool = Incremental + Priority = 10 + Write Bootstrap = "@working_dir@/%c.bsr" + Full Backup Pool = Full # write Full Backups into "Full" Pool (#05) + Differential Backup Pool = Differential # write Diff Backups into "Differential" Pool (#08) + Incremental Backup Pool = Incremental # write Incr Backups into "Incremental" Pool (#11) +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/messages/Daemon.conf.in b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/messages/Daemon.conf.in new file mode 100644 index 00000000000..ce0e5ec6778 --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/messages/Daemon.conf.in @@ -0,0 +1,9 @@ +Messages { + Name = Daemon + Description = "Message delivery for daemon messages (no job)." + mailcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos daemon message\" %r" + mail = @job_email@ = all, !skipped, !audit # (#02) + console = all, !skipped, !saved, !audit + append = "@logdir@/bareos.log" = all, !skipped, !audit + append = "@logdir@/bareos-audit.log" = audit +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/messages/Standard.conf.in b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/messages/Standard.conf.in new file mode 100644 index 00000000000..fdcc1f735e5 --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/messages/Standard.conf.in @@ -0,0 +1,11 @@ +Messages { + Name = Standard + Description = "Reasonable message delivery -- send most everything to email address and to the console." + operatorcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos: Intervention needed for %j\" %r" + mailcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos: %t %e of %c %l\" %r" + operator = @job_email@ = mount # (#03) + mail = @job_email@ = all, !skipped, !saved, !audit # (#02) + console = all, !skipped, !saved, !audit + append = "@logdir@/bareos.log" = all, !skipped, !saved, !audit + catalog = all, !skipped, !saved, !audit +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/pool/Differential.conf b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/pool/Differential.conf new file mode 100644 index 00000000000..25ce24821ab --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/pool/Differential.conf @@ -0,0 +1,10 @@ +Pool { + Name = Differential + Pool Type = Backup + Recycle = yes # Bareos can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 90 days # How long should the Differential Backups be kept? (#09) + Maximum Volume Bytes = 10G # Limit Volume size to something reasonable + Maximum Volumes = 100 # Limit number of Volumes in Pool + Label Format = "Differential-" # Volumes will be labeled "Differential-" +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/pool/Full.conf b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/pool/Full.conf new file mode 100644 index 00000000000..867fc66b483 --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/pool/Full.conf @@ -0,0 +1,10 @@ +Pool { + Name = Full + Pool Type = Backup + Recycle = yes # Bareos can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 365 days # How long should the Full Backups be kept? (#06) + Maximum Volume Bytes = 50G # Limit Volume size to something reasonable + Maximum Volumes = 100 # Limit number of Volumes in Pool + Label Format = "Full-" # Volumes will be labeled "Full-" +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/pool/Incremental.conf b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/pool/Incremental.conf new file mode 100644 index 00000000000..f4dbbab6650 --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/pool/Incremental.conf @@ -0,0 +1,10 @@ +Pool { + Name = Incremental + Pool Type = Backup + Recycle = yes # Bareos can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 30 days # How long should the Incremental Backups be kept? (#12) + Maximum Volume Bytes = 1G # Limit Volume size to something reasonable + Maximum Volumes = 100 # Limit number of Volumes in Pool + Label Format = "Incremental-" # Volumes will be labeled "Incremental-" +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/pool/Scratch.conf b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/pool/Scratch.conf new file mode 100644 index 00000000000..3a489b19871 --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/pool/Scratch.conf @@ -0,0 +1,4 @@ +Pool { + Name = Scratch + Pool Type = Scratch +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/profile/operator.conf b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/profile/operator.conf new file mode 100644 index 00000000000..6edd0166dca --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/profile/operator.conf @@ -0,0 +1,18 @@ +Profile { + Name = operator + Description = "Profile allowing normal Bareos operations." + + Command ACL = !.bvfs_clear_cache, !.exit, !.sql + Command ACL = !configure, !create, !delete, !purge, !prune, !sqlquery, !umount, !unmount + Command ACL = *all* + + Catalog ACL = *all* + Client ACL = *all* + FileSet ACL = *all* + Job ACL = *all* + Plugin Options ACL = *all* + Pool ACL = *all* + Schedule ACL = *all* + Storage ACL = *all* + Where ACL = *all* +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/profile/webui-admin.conf b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/profile/webui-admin.conf new file mode 100644 index 00000000000..860af09e4fa --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/profile/webui-admin.conf @@ -0,0 +1,15 @@ +# +# bareos-webui webui-admin profile resource +# +Profile { + Name = "webui-admin" + CommandACL = !.bvfs_clear_cache, !.exit, !.sql, !configure, !create, !delete, !purge, !prune, !sqlquery, !umount, !unmount, *all* + Job ACL = *all* + Schedule ACL = *all* + Catalog ACL = *all* + Pool ACL = *all* + Storage ACL = *all* + Client ACL = *all* + FileSet ACL = *all* + Where ACL = *all* +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/profile/webui-readonly.conf b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/profile/webui-readonly.conf new file mode 100644 index 00000000000..fde80e8d4c0 --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/profile/webui-readonly.conf @@ -0,0 +1,37 @@ +# +# bareos-webui profile resource: read-only access +# + +Profile { + Name = "webui-readonly" + + # Allow access to the following commands + CommandACL = .api, .help, use, version, status + CommandACL = list, llist + CommandACL = .clients, .jobs, .filesets, .pools, .storages, .defaults, .schedule + CommandACL = .bvfs_lsdirs, .bvfs_lsfiles, .bvfs_update, .bvfs_get_jobids, .bvfs_versions, .bvfs_restore + + # Allow access to the following job resources + Job ACL = *all* + + # Allow access to the following schedule resources + Schedule ACL = *all* + + # Allow access to the following catalog resources + Catalog ACL = *all* + + # Allow access to the following pool resources + Pool ACL = *all* + + # Allow access to the following storage resources + Storage ACL = *all* + + # Allow access to the following client resources + Client ACL = *all* + + # Allow access to the following filset resources + FileSet ACL = *all* + + # Allow access to restore to any filesystem location + Where ACL = *all* +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf new file mode 100644 index 00000000000..a2181c7db3d --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf @@ -0,0 +1,6 @@ +Schedule { + Name = "WeeklyCycle" +# Run = Full 1st sat at 21:00 # (#04) +# Run = Differential 2nd-5th sat at 21:00 # (#07) +# Run = Incremental mon-fri at 21:00 # (#10) +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf new file mode 100644 index 00000000000..49b245671cb --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf @@ -0,0 +1,5 @@ +Schedule { + Name = "WeeklyCycleAfterBackup" + Description = "This schedule does the catalog. It starts after the WeeklyCycle." +# Run = Full mon-fri at 21:10 +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/storage/File.conf.in b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/storage/File.conf.in new file mode 100644 index 00000000000..4058ddc7edc --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-dir.d/storage/File.conf.in @@ -0,0 +1,8 @@ +Storage { + Name = File + Address = @hostname@ # N.B. Use a fully qualified name here (do not use "localhost" here). + Password = "@sd_password@" + Device = FileStorage + Media Type = File + SD Port = @sd_port@ +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-fd.d/client/myself.conf.in b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-fd.d/client/myself.conf.in new file mode 100644 index 00000000000..e218bf06514 --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-fd.d/client/myself.conf.in @@ -0,0 +1,20 @@ +Client { + Name = @basename@-fd + Maximum Concurrent Jobs = 20 + + # remove comment from "Plugin Directory" to load plugins from specified directory. + # if "Plugin Names" is defined, only the specified plugins will be loaded, + # otherwise all filedaemon plugins (*-fd.so) from the "Plugin Directory". + # + # Plugin Directory = "@python_plugin_module_src_fd@" + # Plugin Names = "" + + # if compatible is set to yes, we are compatible with bacula + # if set to no, new bareos features are enabled which is the default + # compatible = yes + + Working Directory = "@working_dir@" + Pid Directory = "@piddir@" + FD Port = @fd_port@ + +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in new file mode 100644 index 00000000000..c8dc7085a45 --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in @@ -0,0 +1,5 @@ +Director { + Name = bareos-dir + Password = "@fd_password@" + Description = "Allow the configured Director to access this file daemon." +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in new file mode 100644 index 00000000000..630c3a9abd3 --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in @@ -0,0 +1,6 @@ +Director { + Name = bareos-mon + Password = "@mon_fd_password@" + Monitor = yes + Description = "Restricted Director, used by tray-monitor to get the status of this file daemon." +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-fd.d/messages/Standard.conf b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-fd.d/messages/Standard.conf new file mode 100644 index 00000000000..97788e00573 --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-fd.d/messages/Standard.conf @@ -0,0 +1,5 @@ +Messages { + Name = Standard + Director = bareos-dir = all, !skipped, !restored + Description = "Send relevant messages to the Director." +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-sd.d/device/FileStorage.conf.in b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-sd.d/device/FileStorage.conf.in new file mode 100644 index 00000000000..d7f2d1dcf19 --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-sd.d/device/FileStorage.conf.in @@ -0,0 +1,11 @@ +Device { + Name = FileStorage + Media Type = File + Archive Device = @archivedir@ + LabelMedia = yes; # lets Bareos label unlabeled media + Random Access = yes; + AutomaticMount = yes; # when device opened, read it + RemovableMedia = no; + AlwaysOpen = no; + Description = "File device. A connecting Director must have the same Name and MediaType." +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in new file mode 100644 index 00000000000..deef3360c2d --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in @@ -0,0 +1,5 @@ +Director { + Name = bareos-dir + Password = "@sd_password@" + Description = "Director, who is permitted to contact this storage daemon." +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in new file mode 100644 index 00000000000..e3cfdee6315 --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in @@ -0,0 +1,6 @@ +Director { + Name = bareos-mon + Password = "@mon_sd_password@" + Monitor = yes + Description = "Restricted Director, used by tray-monitor to get the status of this storage daemon." +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-sd.d/messages/Standard.conf b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-sd.d/messages/Standard.conf new file mode 100644 index 00000000000..468348e62fc --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-sd.d/messages/Standard.conf @@ -0,0 +1,5 @@ +Messages { + Name = Standard + Director = bareos-dir = all + Description = "Send all messages to the Director." +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in new file mode 100644 index 00000000000..3e1723fa60c --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in @@ -0,0 +1,14 @@ +Storage { + Name = bareos-sd + Maximum Concurrent Jobs = 20 + + # remove comment from "Plugin Directory" to load plugins from specified directory. + # if "Plugin Names" is defined, only the specified plugins will be loaded, + # otherwise all storage plugins (*-sd.so) from the "Plugin Directory". + # + # Plugin Directory = "@python_plugin_module_src_sd@" + # Plugin Names = "" + Working Directory = "@working_dir@" + Pid Directory = "@piddir@" + SD Port = @sd_port@ +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/bconsole.conf.in b/systemtests/tests/webui-admin-run-job/etc/bareos/bconsole.conf.in new file mode 100644 index 00000000000..ecb6ad00dce --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/bconsole.conf.in @@ -0,0 +1,10 @@ +# +# Bareos User Agent (or Console) Configuration File +# + +Director { + Name = @basename@-dir + DIRport = @dir_port@ + address = @hostname@ + Password = "@dir_password@" +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in b/systemtests/tests/webui-admin-run-job/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in new file mode 100644 index 00000000000..dd00dd9f103 --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in @@ -0,0 +1,5 @@ +Client { + Name = @basename@-fd + Address = localhost + Password = "@mon_fd_password@" # password for FileDaemon +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/tray-monitor.d/director/Director-local.conf.in b/systemtests/tests/webui-admin-run-job/etc/bareos/tray-monitor.d/director/Director-local.conf.in new file mode 100644 index 00000000000..55dae492250 --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/tray-monitor.d/director/Director-local.conf.in @@ -0,0 +1,4 @@ +Director { + Name = bareos-dir + Address = localhost +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in b/systemtests/tests/webui-admin-run-job/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in new file mode 100644 index 00000000000..cddfa253945 --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in @@ -0,0 +1,7 @@ +Monitor { + # Name to establish connections to Director Console, Storage Daemon and File Daemon. + Name = bareos-mon + # Password to access the Director + Password = "@mon_dir_password@" # password for the Directors + RefreshInterval = 30 seconds +} diff --git a/systemtests/tests/webui-admin-run-job/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in b/systemtests/tests/webui-admin-run-job/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in new file mode 100644 index 00000000000..6538f4fd248 --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in @@ -0,0 +1,5 @@ +Storage { + Name = bareos-sd + Address = localhost + Password = "@mon_sd_password@" # password for StorageDaemon +} diff --git a/systemtests/tests/webui-admin-run-job/testrunner.in b/systemtests/tests/webui-admin-run-job/testrunner.in new file mode 100755 index 00000000000..609b8802f06 --- /dev/null +++ b/systemtests/tests/webui-admin-run-job/testrunner.in @@ -0,0 +1,60 @@ +#!/bin/sh +# +# Run a simple backup +# then restore it. +# +TestName="$(basename "$(pwd)")" +export TestName + +JobName=backup-bareos-fd +. ./environment +. ${scripts}/functions + +${scripts}/cleanup +${scripts}/setup + + +# Directory to backup. +# This directory will be created by setup_data(). +BackupDirectory="${tmp}/data" + +# Use a tgz to setup data to be backed up. +# Data will be placed at "${tmp}/data/". +setup_data + +start_test + +cat <$tmp/bconcmds +@$out /dev/null +messages +@$out $tmp/log1.out +run job=$JobName yes +wait +messages +quit +END_OF_DATA + +run_bareos + +@PHP@ -S 127.0.0.1:@php_port@ -t @PROJECT_SOURCE_DIR@/../webui/public/ >"$tmp/php.out" 2>&1 & + +PHP_PID=$(echo $!) + +# run tests but stop the test run on the first error or failure + +# +# test with admin profile resource +# +export BAREOS_WEBUI_PROFILE=admin +export BAREOS_WEBUI_TESTNAME=test_run_default_job +echo "test with admin profile:" >"$tmp/selenium.out" 2>&1 +@PYTHON@ @CMAKE_SOURCE_DIR@/webui/tests/selenium/webui-selenium-test.py -v SeleniumTest.test_run_default_job >>"$tmp/selenium.out" 2>&1 + +estat=$? +export estat + +kill "${PHP_PID}" + +stop_bareos + +end_test diff --git a/systemtests/tests/webui-readonly-client-disabling/directors.ini.in b/systemtests/tests/webui-readonly-client-disabling/directors.ini.in new file mode 100644 index 00000000000..054b346838c --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/directors.ini.in @@ -0,0 +1,81 @@ +; +; Bareos WebUI Configuration File +; +; File: /usr/local/etc/bareos-webui/directors.ini +; + +;------------------------------------------------------------------------------ +; Section localhost-dir +;------------------------------------------------------------------------------ +[localhost-dir] + +; Enable or disable section. Possible values are "yes" or "no", the default is "yes". +enabled = "yes" + +; Fill in the IP-Address or FQDN of you director. +diraddress = "localhost" + +; Default value is 9101 +dirport = @dir_port@ + +; Set catalog to explicit value if you have multiple catalogs +;catalog = "MyCatalog" + +; Set the console name and password for a dedicated pam console; +; the counterpart console-config in the director must have set +; UsePamAuthentication = yes +;pam_console_name = "admin" +;pam_console_password = "admin" + +; TLS verify peer +; Possible values: true or false +tls_verify_peer = false + +; Server can do TLS +; Possible values: true or false +server_can_do_tls = false + +; Server requires TLS +; Possible values: true or false +server_requires_tls = false + +; Client can do TLS +; Possible values: true or false +client_can_do_tls = false + +; Client requires TLS +; Possible value: true or false +client_requires_tls = false + +; Path to the certificate authority file +; E.g. ca_file = "/usr/local/etc/bareos/tls/BareosCA.crt" +;ca_file = "" + +; Path to the cert file which needs to contain the client certificate and the key in PEM encoding +; E.g. ca_file = "/usr/local/etc/bareos/tls/restricted-named-console.pem" +;cert_file = "" + +; Passphrase needed to unlock the above cert file if set +;cert_file_passphrase = "" + +; Allowed common names +; E.g. allowed_cns = "host1.example.com" +;allowed_cns = "" + +;------------------------------------------------------------------------------ +; Section another-host-dir +;------------------------------------------------------------------------------ +[another-host-dir] +enabled = "no" +diraddress = "192.168.120.1" +dirport = 9101 +;catalog = "MyCatalog" +;tls_verify_peer = false +;server_can_do_tls = false +;server_requires_tls = false +;client_can_do_tls = false +;client_requires_tls = false +;ca_file = "" +;cert_file = "" +;cert_file_passphrase = "" +;allowed_cns = "" diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in new file mode 100644 index 00000000000..479bc6fecbb --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in @@ -0,0 +1,8 @@ +Catalog { + Name = MyCatalog + #dbdriver = "@DEFAULT_DB_TYPE@" + dbdriver = "XXX_REPLACE_WITH_DATABASE_DRIVER_XXX" + dbname = "@db_name@" + dbuser = "@db_user@" + dbpassword = "@db_password@" +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in new file mode 100644 index 00000000000..470ca702035 --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in @@ -0,0 +1,7 @@ +Client { + Name = bareos-fd + Description = "Client resource of the Director itself." + Address = localhost + Password = "@fd_password@" # password for FileDaemon + FD PORT = @fd_port@ +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/console/admin.conf b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/console/admin.conf new file mode 100644 index 00000000000..fe312662e3e --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/console/admin.conf @@ -0,0 +1,17 @@ +# +# Restricted console used by bareos-webui +# +Console { + Name = admin + Password = "admin" + Profile = "webui-admin" + + + # As php does not support TLS-PSK, + # and the director has TLS enabled by default, + # we need to either disable TLS or setup + # TLS with certificates. + # + # For testing purposes we disable it here + TLS Enable = No +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in new file mode 100644 index 00000000000..d276adcb87d --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in @@ -0,0 +1,7 @@ +Console { + Name = bareos-mon + Description = "Restricted console used by tray-monitor to get the status of the director." + Password = "@mon_dir_password@" + CommandACL = status, .status + JobACL = *all* +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/console/readonly.conf b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/console/readonly.conf new file mode 100644 index 00000000000..0ff95010efd --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/console/readonly.conf @@ -0,0 +1,17 @@ +# +# Restricted console used by bareos-webui +# +Console { + Name = readonly + Password = "readonly" + Profile = "webui-readonly" + + + # As php does not support TLS-PSK, + # and the director has TLS enabled by default, + # we need to either disable TLS or setup + # TLS with certificates. + # + # For testing purposes we disable it here + TLS Enable = No +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in new file mode 100644 index 00000000000..33b3a426e3a --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in @@ -0,0 +1,27 @@ +Director { # define myself + Name = bareos-dir + QueryFile = "@scriptdir@/query.sql" + Maximum Concurrent Jobs = 10 + Password = "@dir_password@" # Console password + Messages = Daemon + Auditing = yes + + # Enable the Heartbeat if you experience connection losses + # (eg. because of your router or firewall configuration). + # Additionally the Heartbeat can be enabled in bareos-sd and bareos-fd. + # + # Heartbeat Interval = 1 min + + # remove comment in next line to load dynamic backends from specified directory + Backend Directory = @backenddir@ + + # remove comment from "Plugin Directory" to load plugins from specified directory. + # if "Plugin Names" is defined, only the specified plugins will be loaded, + # otherwise all director plugins (*-dir.so) from the "Plugin Directory". + # + # Plugin Directory = "@python_plugin_module_src_dir@" + # Plugin Names = "" + Working Directory = "@working_dir@" + Pid Directory = "@piddir@" + DirPort = @dir_port@ +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/fileset/Catalog.conf b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/fileset/Catalog.conf new file mode 100644 index 00000000000..ec1a47c971b --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/fileset/Catalog.conf @@ -0,0 +1,11 @@ +FileSet { + Name = "Catalog" + Description = "Backup the catalog dump and Bareos configuration files." + Include { + Options { + signature = MD5 + } + File = "/var/lib/bareos/bareos.sql" # database dump + File = "/usr/local/etc/bareos" # configuration + } +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in new file mode 100644 index 00000000000..c7cdc433fe1 --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in @@ -0,0 +1,11 @@ +FileSet { + Name = "Catalog" + Description = "Backup the catalog dump and Bareos configuration files." + Include { + Options { + signature = MD5 + } + File = "@working_dir@/@db_name@.sql" # database dump + File = "@confdir@" # configuration + } +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf new file mode 100644 index 00000000000..3a3336823ac --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf @@ -0,0 +1,31 @@ +FileSet { + Name = "LinuxAll" + Description = "Backup all regular filesystems, determined by filesystem type." + Include { + Options { + Signature = MD5 # calculate md5 checksum per file + One FS = No # change into other filessytems + FS Type = btrfs + FS Type = ext2 # filesystems of given types will be backed up + FS Type = ext3 # others will be ignored + FS Type = ext4 + FS Type = reiserfs + FS Type = jfs + FS Type = xfs + FS Type = zfs + } + File = / + } + # Things that usually have to be excluded + # You have to exclude /var/lib/bareos/storage + # on your bareos server + Exclude { + File = /var/lib/bareos + File = /var/lib/bareos/storage + File = /proc + File = /tmp + File = /var/tmp + File = /.journal + File = /.fsck + } +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in new file mode 100644 index 00000000000..cee45dfa3ed --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in @@ -0,0 +1,31 @@ +FileSet { + Name = "LinuxAll" + Description = "Backup all regular filesystems, determined by filesystem type." + Include { + Options { + Signature = MD5 # calculate md5 checksum per file + One FS = No # change into other filessytems + FS Type = btrfs + FS Type = ext2 # filesystems of given types will be backed up + FS Type = ext3 # others will be ignored + FS Type = ext4 + FS Type = reiserfs + FS Type = jfs + FS Type = xfs + FS Type = zfs + } + File = / + } + # Things that usually have to be excluded + # You have to exclude @archivedir@ + # on your bareos server + Exclude { + File = @working_dir@ + File = @archivedir@ + File = /proc + File = /tmp + File = /var/tmp + File = /.journal + File = /.fsck + } +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/fileset/SelfTest.conf b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/fileset/SelfTest.conf new file mode 100644 index 00000000000..a117233f531 --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/fileset/SelfTest.conf @@ -0,0 +1,11 @@ +FileSet { + Name = "SelfTest" + Description = "fileset just to backup some files for selftest" + Include { + Options { + Signature = MD5 # calculate md5 checksum per file + } + #File = "/usr/local/sbin" + File= + RunBeforeJob = "@scriptdir@/make_catalog_backup.pl MyCatalog" + + # This deletes the copy of the catalog + RunAfterJob = "@scriptdir@/delete_catalog_backup" + + # This sends the bootstrap via mail for disaster recovery. + # Should be sent to another system, please change recipient accordingly + Write Bootstrap = "|@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \" -s \"Bootstrap for Job %j\" @job_email@" # (#01) + Priority = 11 # run after main backup +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in new file mode 100644 index 00000000000..577f6f9b6bb --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in @@ -0,0 +1,11 @@ +Job { + Name = "RestoreFiles" + Description = "Standard Restore template. Only one such job is needed for all standard Jobs/Clients/Storage ..." + Type = Restore + Client = bareos-fd + FileSet = "LinuxAll" + Storage = File + Pool = Incremental + Messages = Standard + Where = @tmp@/bareos-restores +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in new file mode 100644 index 00000000000..ca1891f9620 --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in @@ -0,0 +1,5 @@ +Job { + Name = "backup-bareos-fd" + JobDefs = "DefaultJob" + Client = "bareos-fd" +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in new file mode 100644 index 00000000000..0d1c0bd04e7 --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in @@ -0,0 +1,16 @@ +JobDefs { + Name = "DefaultJob" + Type = Backup + Level = Incremental + Client = bareos-fd + FileSet = "SelfTest" # selftest fileset (#13) + Schedule = "WeeklyCycle" + Storage = File + Messages = Standard + Pool = Incremental + Priority = 10 + Write Bootstrap = "@working_dir@/%c.bsr" + Full Backup Pool = Full # write Full Backups into "Full" Pool (#05) + Differential Backup Pool = Differential # write Diff Backups into "Differential" Pool (#08) + Incremental Backup Pool = Incremental # write Incr Backups into "Incremental" Pool (#11) +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/messages/Daemon.conf.in b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/messages/Daemon.conf.in new file mode 100644 index 00000000000..ce0e5ec6778 --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/messages/Daemon.conf.in @@ -0,0 +1,9 @@ +Messages { + Name = Daemon + Description = "Message delivery for daemon messages (no job)." + mailcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos daemon message\" %r" + mail = @job_email@ = all, !skipped, !audit # (#02) + console = all, !skipped, !saved, !audit + append = "@logdir@/bareos.log" = all, !skipped, !audit + append = "@logdir@/bareos-audit.log" = audit +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/messages/Standard.conf.in b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/messages/Standard.conf.in new file mode 100644 index 00000000000..fdcc1f735e5 --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/messages/Standard.conf.in @@ -0,0 +1,11 @@ +Messages { + Name = Standard + Description = "Reasonable message delivery -- send most everything to email address and to the console." + operatorcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos: Intervention needed for %j\" %r" + mailcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos: %t %e of %c %l\" %r" + operator = @job_email@ = mount # (#03) + mail = @job_email@ = all, !skipped, !saved, !audit # (#02) + console = all, !skipped, !saved, !audit + append = "@logdir@/bareos.log" = all, !skipped, !saved, !audit + catalog = all, !skipped, !saved, !audit +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/pool/Differential.conf b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/pool/Differential.conf new file mode 100644 index 00000000000..25ce24821ab --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/pool/Differential.conf @@ -0,0 +1,10 @@ +Pool { + Name = Differential + Pool Type = Backup + Recycle = yes # Bareos can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 90 days # How long should the Differential Backups be kept? (#09) + Maximum Volume Bytes = 10G # Limit Volume size to something reasonable + Maximum Volumes = 100 # Limit number of Volumes in Pool + Label Format = "Differential-" # Volumes will be labeled "Differential-" +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/pool/Full.conf b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/pool/Full.conf new file mode 100644 index 00000000000..867fc66b483 --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/pool/Full.conf @@ -0,0 +1,10 @@ +Pool { + Name = Full + Pool Type = Backup + Recycle = yes # Bareos can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 365 days # How long should the Full Backups be kept? (#06) + Maximum Volume Bytes = 50G # Limit Volume size to something reasonable + Maximum Volumes = 100 # Limit number of Volumes in Pool + Label Format = "Full-" # Volumes will be labeled "Full-" +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/pool/Incremental.conf b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/pool/Incremental.conf new file mode 100644 index 00000000000..f4dbbab6650 --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/pool/Incremental.conf @@ -0,0 +1,10 @@ +Pool { + Name = Incremental + Pool Type = Backup + Recycle = yes # Bareos can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 30 days # How long should the Incremental Backups be kept? (#12) + Maximum Volume Bytes = 1G # Limit Volume size to something reasonable + Maximum Volumes = 100 # Limit number of Volumes in Pool + Label Format = "Incremental-" # Volumes will be labeled "Incremental-" +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/pool/Scratch.conf b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/pool/Scratch.conf new file mode 100644 index 00000000000..3a489b19871 --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/pool/Scratch.conf @@ -0,0 +1,4 @@ +Pool { + Name = Scratch + Pool Type = Scratch +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/profile/operator.conf b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/profile/operator.conf new file mode 100644 index 00000000000..6edd0166dca --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/profile/operator.conf @@ -0,0 +1,18 @@ +Profile { + Name = operator + Description = "Profile allowing normal Bareos operations." + + Command ACL = !.bvfs_clear_cache, !.exit, !.sql + Command ACL = !configure, !create, !delete, !purge, !prune, !sqlquery, !umount, !unmount + Command ACL = *all* + + Catalog ACL = *all* + Client ACL = *all* + FileSet ACL = *all* + Job ACL = *all* + Plugin Options ACL = *all* + Pool ACL = *all* + Schedule ACL = *all* + Storage ACL = *all* + Where ACL = *all* +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/profile/webui-admin.conf b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/profile/webui-admin.conf new file mode 100644 index 00000000000..860af09e4fa --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/profile/webui-admin.conf @@ -0,0 +1,15 @@ +# +# bareos-webui webui-admin profile resource +# +Profile { + Name = "webui-admin" + CommandACL = !.bvfs_clear_cache, !.exit, !.sql, !configure, !create, !delete, !purge, !prune, !sqlquery, !umount, !unmount, *all* + Job ACL = *all* + Schedule ACL = *all* + Catalog ACL = *all* + Pool ACL = *all* + Storage ACL = *all* + Client ACL = *all* + FileSet ACL = *all* + Where ACL = *all* +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/profile/webui-readonly.conf b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/profile/webui-readonly.conf new file mode 100644 index 00000000000..fde80e8d4c0 --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/profile/webui-readonly.conf @@ -0,0 +1,37 @@ +# +# bareos-webui profile resource: read-only access +# + +Profile { + Name = "webui-readonly" + + # Allow access to the following commands + CommandACL = .api, .help, use, version, status + CommandACL = list, llist + CommandACL = .clients, .jobs, .filesets, .pools, .storages, .defaults, .schedule + CommandACL = .bvfs_lsdirs, .bvfs_lsfiles, .bvfs_update, .bvfs_get_jobids, .bvfs_versions, .bvfs_restore + + # Allow access to the following job resources + Job ACL = *all* + + # Allow access to the following schedule resources + Schedule ACL = *all* + + # Allow access to the following catalog resources + Catalog ACL = *all* + + # Allow access to the following pool resources + Pool ACL = *all* + + # Allow access to the following storage resources + Storage ACL = *all* + + # Allow access to the following client resources + Client ACL = *all* + + # Allow access to the following filset resources + FileSet ACL = *all* + + # Allow access to restore to any filesystem location + Where ACL = *all* +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf new file mode 100644 index 00000000000..a2181c7db3d --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf @@ -0,0 +1,6 @@ +Schedule { + Name = "WeeklyCycle" +# Run = Full 1st sat at 21:00 # (#04) +# Run = Differential 2nd-5th sat at 21:00 # (#07) +# Run = Incremental mon-fri at 21:00 # (#10) +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf new file mode 100644 index 00000000000..49b245671cb --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf @@ -0,0 +1,5 @@ +Schedule { + Name = "WeeklyCycleAfterBackup" + Description = "This schedule does the catalog. It starts after the WeeklyCycle." +# Run = Full mon-fri at 21:10 +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/storage/File.conf.in b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/storage/File.conf.in new file mode 100644 index 00000000000..4058ddc7edc --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-dir.d/storage/File.conf.in @@ -0,0 +1,8 @@ +Storage { + Name = File + Address = @hostname@ # N.B. Use a fully qualified name here (do not use "localhost" here). + Password = "@sd_password@" + Device = FileStorage + Media Type = File + SD Port = @sd_port@ +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-fd.d/client/myself.conf.in b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-fd.d/client/myself.conf.in new file mode 100644 index 00000000000..e218bf06514 --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-fd.d/client/myself.conf.in @@ -0,0 +1,20 @@ +Client { + Name = @basename@-fd + Maximum Concurrent Jobs = 20 + + # remove comment from "Plugin Directory" to load plugins from specified directory. + # if "Plugin Names" is defined, only the specified plugins will be loaded, + # otherwise all filedaemon plugins (*-fd.so) from the "Plugin Directory". + # + # Plugin Directory = "@python_plugin_module_src_fd@" + # Plugin Names = "" + + # if compatible is set to yes, we are compatible with bacula + # if set to no, new bareos features are enabled which is the default + # compatible = yes + + Working Directory = "@working_dir@" + Pid Directory = "@piddir@" + FD Port = @fd_port@ + +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in new file mode 100644 index 00000000000..c8dc7085a45 --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in @@ -0,0 +1,5 @@ +Director { + Name = bareos-dir + Password = "@fd_password@" + Description = "Allow the configured Director to access this file daemon." +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in new file mode 100644 index 00000000000..630c3a9abd3 --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in @@ -0,0 +1,6 @@ +Director { + Name = bareos-mon + Password = "@mon_fd_password@" + Monitor = yes + Description = "Restricted Director, used by tray-monitor to get the status of this file daemon." +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-fd.d/messages/Standard.conf b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-fd.d/messages/Standard.conf new file mode 100644 index 00000000000..97788e00573 --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-fd.d/messages/Standard.conf @@ -0,0 +1,5 @@ +Messages { + Name = Standard + Director = bareos-dir = all, !skipped, !restored + Description = "Send relevant messages to the Director." +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-sd.d/device/FileStorage.conf.in b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-sd.d/device/FileStorage.conf.in new file mode 100644 index 00000000000..d7f2d1dcf19 --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-sd.d/device/FileStorage.conf.in @@ -0,0 +1,11 @@ +Device { + Name = FileStorage + Media Type = File + Archive Device = @archivedir@ + LabelMedia = yes; # lets Bareos label unlabeled media + Random Access = yes; + AutomaticMount = yes; # when device opened, read it + RemovableMedia = no; + AlwaysOpen = no; + Description = "File device. A connecting Director must have the same Name and MediaType." +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in new file mode 100644 index 00000000000..deef3360c2d --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in @@ -0,0 +1,5 @@ +Director { + Name = bareos-dir + Password = "@sd_password@" + Description = "Director, who is permitted to contact this storage daemon." +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in new file mode 100644 index 00000000000..e3cfdee6315 --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in @@ -0,0 +1,6 @@ +Director { + Name = bareos-mon + Password = "@mon_sd_password@" + Monitor = yes + Description = "Restricted Director, used by tray-monitor to get the status of this storage daemon." +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-sd.d/messages/Standard.conf b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-sd.d/messages/Standard.conf new file mode 100644 index 00000000000..468348e62fc --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-sd.d/messages/Standard.conf @@ -0,0 +1,5 @@ +Messages { + Name = Standard + Director = bareos-dir = all + Description = "Send all messages to the Director." +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in new file mode 100644 index 00000000000..3e1723fa60c --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in @@ -0,0 +1,14 @@ +Storage { + Name = bareos-sd + Maximum Concurrent Jobs = 20 + + # remove comment from "Plugin Directory" to load plugins from specified directory. + # if "Plugin Names" is defined, only the specified plugins will be loaded, + # otherwise all storage plugins (*-sd.so) from the "Plugin Directory". + # + # Plugin Directory = "@python_plugin_module_src_sd@" + # Plugin Names = "" + Working Directory = "@working_dir@" + Pid Directory = "@piddir@" + SD Port = @sd_port@ +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bconsole.conf.in b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bconsole.conf.in new file mode 100644 index 00000000000..ecb6ad00dce --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/bconsole.conf.in @@ -0,0 +1,10 @@ +# +# Bareos User Agent (or Console) Configuration File +# + +Director { + Name = @basename@-dir + DIRport = @dir_port@ + address = @hostname@ + Password = "@dir_password@" +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in new file mode 100644 index 00000000000..dd00dd9f103 --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in @@ -0,0 +1,5 @@ +Client { + Name = @basename@-fd + Address = localhost + Password = "@mon_fd_password@" # password for FileDaemon +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/tray-monitor.d/director/Director-local.conf.in b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/tray-monitor.d/director/Director-local.conf.in new file mode 100644 index 00000000000..55dae492250 --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/tray-monitor.d/director/Director-local.conf.in @@ -0,0 +1,4 @@ +Director { + Name = bareos-dir + Address = localhost +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in new file mode 100644 index 00000000000..cddfa253945 --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in @@ -0,0 +1,7 @@ +Monitor { + # Name to establish connections to Director Console, Storage Daemon and File Daemon. + Name = bareos-mon + # Password to access the Director + Password = "@mon_dir_password@" # password for the Directors + RefreshInterval = 30 seconds +} diff --git a/systemtests/tests/webui-readonly-client-disabling/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in new file mode 100644 index 00000000000..6538f4fd248 --- /dev/null +++ b/systemtests/tests/webui-readonly-client-disabling/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in @@ -0,0 +1,5 @@ +Storage { + Name = bareos-sd + Address = localhost + Password = "@mon_sd_password@" # password for StorageDaemon +} diff --git a/systemtests/tests/webui-selenium/testrunner.in b/systemtests/tests/webui-readonly-client-disabling/testrunner.in similarity index 79% rename from systemtests/tests/webui-selenium/testrunner.in rename to systemtests/tests/webui-readonly-client-disabling/testrunner.in index 58acd64f005..fc481d98a35 100755 --- a/systemtests/tests/webui-selenium/testrunner.in +++ b/systemtests/tests/webui-readonly-client-disabling/testrunner.in @@ -42,21 +42,15 @@ PHP_PID=$(echo $!) # run tests but stop the test run on the first error or failure -# -# test with admin profile resource -# -export BAREOS_WEBUI_PROFILE=admin -echo "test with admin profile:" >"$tmp/selenium.out" 2>&1 -@PYTHON@ @CMAKE_SOURCE_DIR@/webui/tests/selenium/webui-selenium-test.py --fail >>"$tmp/selenium.out" 2>&1 - # # test with readonly profile resource # export BAREOS_WEBUI_USERNAME=readonly export BAREOS_WEBUI_PASSWORD=readonly export BAREOS_WEBUI_PROFILE=readonly +export BAREOS_WEBUI_TESTNAME=test_client_disabling echo "test with readonly profile:" >>"$tmp/selenium.out" 2>&1 -@PYTHON@ @CMAKE_SOURCE_DIR@/webui/tests/selenium/webui-selenium-test.py --fail >>"$tmp/selenium.out" 2>&1 +@PYTHON@ @CMAKE_SOURCE_DIR@/webui/tests/selenium/webui-selenium-test.py -v SeleniumTest.test_client_disabling >>"$tmp/selenium.out" 2>&1 estat=$? export estat diff --git a/systemtests/tests/webui-readonly-rerun-job/directors.ini.in b/systemtests/tests/webui-readonly-rerun-job/directors.ini.in new file mode 100644 index 00000000000..054b346838c --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/directors.ini.in @@ -0,0 +1,81 @@ +; +; Bareos WebUI Configuration File +; +; File: /usr/local/etc/bareos-webui/directors.ini +; + +;------------------------------------------------------------------------------ +; Section localhost-dir +;------------------------------------------------------------------------------ +[localhost-dir] + +; Enable or disable section. Possible values are "yes" or "no", the default is "yes". +enabled = "yes" + +; Fill in the IP-Address or FQDN of you director. +diraddress = "localhost" + +; Default value is 9101 +dirport = @dir_port@ + +; Set catalog to explicit value if you have multiple catalogs +;catalog = "MyCatalog" + +; Set the console name and password for a dedicated pam console; +; the counterpart console-config in the director must have set +; UsePamAuthentication = yes +;pam_console_name = "admin" +;pam_console_password = "admin" + +; TLS verify peer +; Possible values: true or false +tls_verify_peer = false + +; Server can do TLS +; Possible values: true or false +server_can_do_tls = false + +; Server requires TLS +; Possible values: true or false +server_requires_tls = false + +; Client can do TLS +; Possible values: true or false +client_can_do_tls = false + +; Client requires TLS +; Possible value: true or false +client_requires_tls = false + +; Path to the certificate authority file +; E.g. ca_file = "/usr/local/etc/bareos/tls/BareosCA.crt" +;ca_file = "" + +; Path to the cert file which needs to contain the client certificate and the key in PEM encoding +; E.g. ca_file = "/usr/local/etc/bareos/tls/restricted-named-console.pem" +;cert_file = "" + +; Passphrase needed to unlock the above cert file if set +;cert_file_passphrase = "" + +; Allowed common names +; E.g. allowed_cns = "host1.example.com" +;allowed_cns = "" + +;------------------------------------------------------------------------------ +; Section another-host-dir +;------------------------------------------------------------------------------ +[another-host-dir] +enabled = "no" +diraddress = "192.168.120.1" +dirport = 9101 +;catalog = "MyCatalog" +;tls_verify_peer = false +;server_can_do_tls = false +;server_requires_tls = false +;client_can_do_tls = false +;client_requires_tls = false +;ca_file = "" +;cert_file = "" +;cert_file_passphrase = "" +;allowed_cns = "" diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in new file mode 100644 index 00000000000..479bc6fecbb --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in @@ -0,0 +1,8 @@ +Catalog { + Name = MyCatalog + #dbdriver = "@DEFAULT_DB_TYPE@" + dbdriver = "XXX_REPLACE_WITH_DATABASE_DRIVER_XXX" + dbname = "@db_name@" + dbuser = "@db_user@" + dbpassword = "@db_password@" +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in new file mode 100644 index 00000000000..470ca702035 --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in @@ -0,0 +1,7 @@ +Client { + Name = bareos-fd + Description = "Client resource of the Director itself." + Address = localhost + Password = "@fd_password@" # password for FileDaemon + FD PORT = @fd_port@ +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/console/admin.conf b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/console/admin.conf new file mode 100644 index 00000000000..fe312662e3e --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/console/admin.conf @@ -0,0 +1,17 @@ +# +# Restricted console used by bareos-webui +# +Console { + Name = admin + Password = "admin" + Profile = "webui-admin" + + + # As php does not support TLS-PSK, + # and the director has TLS enabled by default, + # we need to either disable TLS or setup + # TLS with certificates. + # + # For testing purposes we disable it here + TLS Enable = No +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in new file mode 100644 index 00000000000..d276adcb87d --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in @@ -0,0 +1,7 @@ +Console { + Name = bareos-mon + Description = "Restricted console used by tray-monitor to get the status of the director." + Password = "@mon_dir_password@" + CommandACL = status, .status + JobACL = *all* +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/console/readonly.conf b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/console/readonly.conf new file mode 100644 index 00000000000..0ff95010efd --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/console/readonly.conf @@ -0,0 +1,17 @@ +# +# Restricted console used by bareos-webui +# +Console { + Name = readonly + Password = "readonly" + Profile = "webui-readonly" + + + # As php does not support TLS-PSK, + # and the director has TLS enabled by default, + # we need to either disable TLS or setup + # TLS with certificates. + # + # For testing purposes we disable it here + TLS Enable = No +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in new file mode 100644 index 00000000000..33b3a426e3a --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in @@ -0,0 +1,27 @@ +Director { # define myself + Name = bareos-dir + QueryFile = "@scriptdir@/query.sql" + Maximum Concurrent Jobs = 10 + Password = "@dir_password@" # Console password + Messages = Daemon + Auditing = yes + + # Enable the Heartbeat if you experience connection losses + # (eg. because of your router or firewall configuration). + # Additionally the Heartbeat can be enabled in bareos-sd and bareos-fd. + # + # Heartbeat Interval = 1 min + + # remove comment in next line to load dynamic backends from specified directory + Backend Directory = @backenddir@ + + # remove comment from "Plugin Directory" to load plugins from specified directory. + # if "Plugin Names" is defined, only the specified plugins will be loaded, + # otherwise all director plugins (*-dir.so) from the "Plugin Directory". + # + # Plugin Directory = "@python_plugin_module_src_dir@" + # Plugin Names = "" + Working Directory = "@working_dir@" + Pid Directory = "@piddir@" + DirPort = @dir_port@ +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf new file mode 100644 index 00000000000..ec1a47c971b --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf @@ -0,0 +1,11 @@ +FileSet { + Name = "Catalog" + Description = "Backup the catalog dump and Bareos configuration files." + Include { + Options { + signature = MD5 + } + File = "/var/lib/bareos/bareos.sql" # database dump + File = "/usr/local/etc/bareos" # configuration + } +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in new file mode 100644 index 00000000000..c7cdc433fe1 --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in @@ -0,0 +1,11 @@ +FileSet { + Name = "Catalog" + Description = "Backup the catalog dump and Bareos configuration files." + Include { + Options { + signature = MD5 + } + File = "@working_dir@/@db_name@.sql" # database dump + File = "@confdir@" # configuration + } +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf new file mode 100644 index 00000000000..3a3336823ac --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf @@ -0,0 +1,31 @@ +FileSet { + Name = "LinuxAll" + Description = "Backup all regular filesystems, determined by filesystem type." + Include { + Options { + Signature = MD5 # calculate md5 checksum per file + One FS = No # change into other filessytems + FS Type = btrfs + FS Type = ext2 # filesystems of given types will be backed up + FS Type = ext3 # others will be ignored + FS Type = ext4 + FS Type = reiserfs + FS Type = jfs + FS Type = xfs + FS Type = zfs + } + File = / + } + # Things that usually have to be excluded + # You have to exclude /var/lib/bareos/storage + # on your bareos server + Exclude { + File = /var/lib/bareos + File = /var/lib/bareos/storage + File = /proc + File = /tmp + File = /var/tmp + File = /.journal + File = /.fsck + } +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in new file mode 100644 index 00000000000..cee45dfa3ed --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in @@ -0,0 +1,31 @@ +FileSet { + Name = "LinuxAll" + Description = "Backup all regular filesystems, determined by filesystem type." + Include { + Options { + Signature = MD5 # calculate md5 checksum per file + One FS = No # change into other filessytems + FS Type = btrfs + FS Type = ext2 # filesystems of given types will be backed up + FS Type = ext3 # others will be ignored + FS Type = ext4 + FS Type = reiserfs + FS Type = jfs + FS Type = xfs + FS Type = zfs + } + File = / + } + # Things that usually have to be excluded + # You have to exclude @archivedir@ + # on your bareos server + Exclude { + File = @working_dir@ + File = @archivedir@ + File = /proc + File = /tmp + File = /var/tmp + File = /.journal + File = /.fsck + } +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/fileset/SelfTest.conf b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/fileset/SelfTest.conf new file mode 100644 index 00000000000..a117233f531 --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/fileset/SelfTest.conf @@ -0,0 +1,11 @@ +FileSet { + Name = "SelfTest" + Description = "fileset just to backup some files for selftest" + Include { + Options { + Signature = MD5 # calculate md5 checksum per file + } + #File = "/usr/local/sbin" + File= + RunBeforeJob = "@scriptdir@/make_catalog_backup.pl MyCatalog" + + # This deletes the copy of the catalog + RunAfterJob = "@scriptdir@/delete_catalog_backup" + + # This sends the bootstrap via mail for disaster recovery. + # Should be sent to another system, please change recipient accordingly + Write Bootstrap = "|@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \" -s \"Bootstrap for Job %j\" @job_email@" # (#01) + Priority = 11 # run after main backup +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in new file mode 100644 index 00000000000..577f6f9b6bb --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in @@ -0,0 +1,11 @@ +Job { + Name = "RestoreFiles" + Description = "Standard Restore template. Only one such job is needed for all standard Jobs/Clients/Storage ..." + Type = Restore + Client = bareos-fd + FileSet = "LinuxAll" + Storage = File + Pool = Incremental + Messages = Standard + Where = @tmp@/bareos-restores +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in new file mode 100644 index 00000000000..ca1891f9620 --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in @@ -0,0 +1,5 @@ +Job { + Name = "backup-bareos-fd" + JobDefs = "DefaultJob" + Client = "bareos-fd" +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in new file mode 100644 index 00000000000..0d1c0bd04e7 --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in @@ -0,0 +1,16 @@ +JobDefs { + Name = "DefaultJob" + Type = Backup + Level = Incremental + Client = bareos-fd + FileSet = "SelfTest" # selftest fileset (#13) + Schedule = "WeeklyCycle" + Storage = File + Messages = Standard + Pool = Incremental + Priority = 10 + Write Bootstrap = "@working_dir@/%c.bsr" + Full Backup Pool = Full # write Full Backups into "Full" Pool (#05) + Differential Backup Pool = Differential # write Diff Backups into "Differential" Pool (#08) + Incremental Backup Pool = Incremental # write Incr Backups into "Incremental" Pool (#11) +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/messages/Daemon.conf.in b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/messages/Daemon.conf.in new file mode 100644 index 00000000000..ce0e5ec6778 --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/messages/Daemon.conf.in @@ -0,0 +1,9 @@ +Messages { + Name = Daemon + Description = "Message delivery for daemon messages (no job)." + mailcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos daemon message\" %r" + mail = @job_email@ = all, !skipped, !audit # (#02) + console = all, !skipped, !saved, !audit + append = "@logdir@/bareos.log" = all, !skipped, !audit + append = "@logdir@/bareos-audit.log" = audit +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/messages/Standard.conf.in b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/messages/Standard.conf.in new file mode 100644 index 00000000000..fdcc1f735e5 --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/messages/Standard.conf.in @@ -0,0 +1,11 @@ +Messages { + Name = Standard + Description = "Reasonable message delivery -- send most everything to email address and to the console." + operatorcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos: Intervention needed for %j\" %r" + mailcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos: %t %e of %c %l\" %r" + operator = @job_email@ = mount # (#03) + mail = @job_email@ = all, !skipped, !saved, !audit # (#02) + console = all, !skipped, !saved, !audit + append = "@logdir@/bareos.log" = all, !skipped, !saved, !audit + catalog = all, !skipped, !saved, !audit +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/pool/Differential.conf b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/pool/Differential.conf new file mode 100644 index 00000000000..25ce24821ab --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/pool/Differential.conf @@ -0,0 +1,10 @@ +Pool { + Name = Differential + Pool Type = Backup + Recycle = yes # Bareos can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 90 days # How long should the Differential Backups be kept? (#09) + Maximum Volume Bytes = 10G # Limit Volume size to something reasonable + Maximum Volumes = 100 # Limit number of Volumes in Pool + Label Format = "Differential-" # Volumes will be labeled "Differential-" +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/pool/Full.conf b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/pool/Full.conf new file mode 100644 index 00000000000..867fc66b483 --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/pool/Full.conf @@ -0,0 +1,10 @@ +Pool { + Name = Full + Pool Type = Backup + Recycle = yes # Bareos can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 365 days # How long should the Full Backups be kept? (#06) + Maximum Volume Bytes = 50G # Limit Volume size to something reasonable + Maximum Volumes = 100 # Limit number of Volumes in Pool + Label Format = "Full-" # Volumes will be labeled "Full-" +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/pool/Incremental.conf b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/pool/Incremental.conf new file mode 100644 index 00000000000..f4dbbab6650 --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/pool/Incremental.conf @@ -0,0 +1,10 @@ +Pool { + Name = Incremental + Pool Type = Backup + Recycle = yes # Bareos can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 30 days # How long should the Incremental Backups be kept? (#12) + Maximum Volume Bytes = 1G # Limit Volume size to something reasonable + Maximum Volumes = 100 # Limit number of Volumes in Pool + Label Format = "Incremental-" # Volumes will be labeled "Incremental-" +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/pool/Scratch.conf b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/pool/Scratch.conf new file mode 100644 index 00000000000..3a489b19871 --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/pool/Scratch.conf @@ -0,0 +1,4 @@ +Pool { + Name = Scratch + Pool Type = Scratch +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/profile/operator.conf b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/profile/operator.conf new file mode 100644 index 00000000000..6edd0166dca --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/profile/operator.conf @@ -0,0 +1,18 @@ +Profile { + Name = operator + Description = "Profile allowing normal Bareos operations." + + Command ACL = !.bvfs_clear_cache, !.exit, !.sql + Command ACL = !configure, !create, !delete, !purge, !prune, !sqlquery, !umount, !unmount + Command ACL = *all* + + Catalog ACL = *all* + Client ACL = *all* + FileSet ACL = *all* + Job ACL = *all* + Plugin Options ACL = *all* + Pool ACL = *all* + Schedule ACL = *all* + Storage ACL = *all* + Where ACL = *all* +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/profile/webui-admin.conf b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/profile/webui-admin.conf new file mode 100644 index 00000000000..860af09e4fa --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/profile/webui-admin.conf @@ -0,0 +1,15 @@ +# +# bareos-webui webui-admin profile resource +# +Profile { + Name = "webui-admin" + CommandACL = !.bvfs_clear_cache, !.exit, !.sql, !configure, !create, !delete, !purge, !prune, !sqlquery, !umount, !unmount, *all* + Job ACL = *all* + Schedule ACL = *all* + Catalog ACL = *all* + Pool ACL = *all* + Storage ACL = *all* + Client ACL = *all* + FileSet ACL = *all* + Where ACL = *all* +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/profile/webui-readonly.conf b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/profile/webui-readonly.conf new file mode 100644 index 00000000000..fde80e8d4c0 --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/profile/webui-readonly.conf @@ -0,0 +1,37 @@ +# +# bareos-webui profile resource: read-only access +# + +Profile { + Name = "webui-readonly" + + # Allow access to the following commands + CommandACL = .api, .help, use, version, status + CommandACL = list, llist + CommandACL = .clients, .jobs, .filesets, .pools, .storages, .defaults, .schedule + CommandACL = .bvfs_lsdirs, .bvfs_lsfiles, .bvfs_update, .bvfs_get_jobids, .bvfs_versions, .bvfs_restore + + # Allow access to the following job resources + Job ACL = *all* + + # Allow access to the following schedule resources + Schedule ACL = *all* + + # Allow access to the following catalog resources + Catalog ACL = *all* + + # Allow access to the following pool resources + Pool ACL = *all* + + # Allow access to the following storage resources + Storage ACL = *all* + + # Allow access to the following client resources + Client ACL = *all* + + # Allow access to the following filset resources + FileSet ACL = *all* + + # Allow access to restore to any filesystem location + Where ACL = *all* +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf new file mode 100644 index 00000000000..a2181c7db3d --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf @@ -0,0 +1,6 @@ +Schedule { + Name = "WeeklyCycle" +# Run = Full 1st sat at 21:00 # (#04) +# Run = Differential 2nd-5th sat at 21:00 # (#07) +# Run = Incremental mon-fri at 21:00 # (#10) +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf new file mode 100644 index 00000000000..49b245671cb --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf @@ -0,0 +1,5 @@ +Schedule { + Name = "WeeklyCycleAfterBackup" + Description = "This schedule does the catalog. It starts after the WeeklyCycle." +# Run = Full mon-fri at 21:10 +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/storage/File.conf.in b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/storage/File.conf.in new file mode 100644 index 00000000000..4058ddc7edc --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-dir.d/storage/File.conf.in @@ -0,0 +1,8 @@ +Storage { + Name = File + Address = @hostname@ # N.B. Use a fully qualified name here (do not use "localhost" here). + Password = "@sd_password@" + Device = FileStorage + Media Type = File + SD Port = @sd_port@ +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-fd.d/client/myself.conf.in b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-fd.d/client/myself.conf.in new file mode 100644 index 00000000000..e218bf06514 --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-fd.d/client/myself.conf.in @@ -0,0 +1,20 @@ +Client { + Name = @basename@-fd + Maximum Concurrent Jobs = 20 + + # remove comment from "Plugin Directory" to load plugins from specified directory. + # if "Plugin Names" is defined, only the specified plugins will be loaded, + # otherwise all filedaemon plugins (*-fd.so) from the "Plugin Directory". + # + # Plugin Directory = "@python_plugin_module_src_fd@" + # Plugin Names = "" + + # if compatible is set to yes, we are compatible with bacula + # if set to no, new bareos features are enabled which is the default + # compatible = yes + + Working Directory = "@working_dir@" + Pid Directory = "@piddir@" + FD Port = @fd_port@ + +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in new file mode 100644 index 00000000000..c8dc7085a45 --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in @@ -0,0 +1,5 @@ +Director { + Name = bareos-dir + Password = "@fd_password@" + Description = "Allow the configured Director to access this file daemon." +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in new file mode 100644 index 00000000000..630c3a9abd3 --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in @@ -0,0 +1,6 @@ +Director { + Name = bareos-mon + Password = "@mon_fd_password@" + Monitor = yes + Description = "Restricted Director, used by tray-monitor to get the status of this file daemon." +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-fd.d/messages/Standard.conf b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-fd.d/messages/Standard.conf new file mode 100644 index 00000000000..97788e00573 --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-fd.d/messages/Standard.conf @@ -0,0 +1,5 @@ +Messages { + Name = Standard + Director = bareos-dir = all, !skipped, !restored + Description = "Send relevant messages to the Director." +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-sd.d/device/FileStorage.conf.in b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-sd.d/device/FileStorage.conf.in new file mode 100644 index 00000000000..d7f2d1dcf19 --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-sd.d/device/FileStorage.conf.in @@ -0,0 +1,11 @@ +Device { + Name = FileStorage + Media Type = File + Archive Device = @archivedir@ + LabelMedia = yes; # lets Bareos label unlabeled media + Random Access = yes; + AutomaticMount = yes; # when device opened, read it + RemovableMedia = no; + AlwaysOpen = no; + Description = "File device. A connecting Director must have the same Name and MediaType." +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in new file mode 100644 index 00000000000..deef3360c2d --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in @@ -0,0 +1,5 @@ +Director { + Name = bareos-dir + Password = "@sd_password@" + Description = "Director, who is permitted to contact this storage daemon." +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in new file mode 100644 index 00000000000..e3cfdee6315 --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in @@ -0,0 +1,6 @@ +Director { + Name = bareos-mon + Password = "@mon_sd_password@" + Monitor = yes + Description = "Restricted Director, used by tray-monitor to get the status of this storage daemon." +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-sd.d/messages/Standard.conf b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-sd.d/messages/Standard.conf new file mode 100644 index 00000000000..468348e62fc --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-sd.d/messages/Standard.conf @@ -0,0 +1,5 @@ +Messages { + Name = Standard + Director = bareos-dir = all + Description = "Send all messages to the Director." +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in new file mode 100644 index 00000000000..3e1723fa60c --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in @@ -0,0 +1,14 @@ +Storage { + Name = bareos-sd + Maximum Concurrent Jobs = 20 + + # remove comment from "Plugin Directory" to load plugins from specified directory. + # if "Plugin Names" is defined, only the specified plugins will be loaded, + # otherwise all storage plugins (*-sd.so) from the "Plugin Directory". + # + # Plugin Directory = "@python_plugin_module_src_sd@" + # Plugin Names = "" + Working Directory = "@working_dir@" + Pid Directory = "@piddir@" + SD Port = @sd_port@ +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bconsole.conf.in b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bconsole.conf.in new file mode 100644 index 00000000000..ecb6ad00dce --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/bconsole.conf.in @@ -0,0 +1,10 @@ +# +# Bareos User Agent (or Console) Configuration File +# + +Director { + Name = @basename@-dir + DIRport = @dir_port@ + address = @hostname@ + Password = "@dir_password@" +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in new file mode 100644 index 00000000000..dd00dd9f103 --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in @@ -0,0 +1,5 @@ +Client { + Name = @basename@-fd + Address = localhost + Password = "@mon_fd_password@" # password for FileDaemon +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/tray-monitor.d/director/Director-local.conf.in b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/tray-monitor.d/director/Director-local.conf.in new file mode 100644 index 00000000000..55dae492250 --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/tray-monitor.d/director/Director-local.conf.in @@ -0,0 +1,4 @@ +Director { + Name = bareos-dir + Address = localhost +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in new file mode 100644 index 00000000000..cddfa253945 --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in @@ -0,0 +1,7 @@ +Monitor { + # Name to establish connections to Director Console, Storage Daemon and File Daemon. + Name = bareos-mon + # Password to access the Director + Password = "@mon_dir_password@" # password for the Directors + RefreshInterval = 30 seconds +} diff --git a/systemtests/tests/webui-readonly-rerun-job/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in new file mode 100644 index 00000000000..6538f4fd248 --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in @@ -0,0 +1,5 @@ +Storage { + Name = bareos-sd + Address = localhost + Password = "@mon_sd_password@" # password for StorageDaemon +} diff --git a/systemtests/tests/webui-readonly-rerun-job/testrunner.in b/systemtests/tests/webui-readonly-rerun-job/testrunner.in new file mode 100755 index 00000000000..87b94ee2c86 --- /dev/null +++ b/systemtests/tests/webui-readonly-rerun-job/testrunner.in @@ -0,0 +1,62 @@ +#!/bin/sh +# +# Run a simple backup +# then restore it. +# +TestName="$(basename "$(pwd)")" +export TestName + +JobName=backup-bareos-fd +. ./environment +. ${scripts}/functions + +${scripts}/cleanup +${scripts}/setup + + +# Directory to backup. +# This directory will be created by setup_data(). +BackupDirectory="${tmp}/data" + +# Use a tgz to setup data to be backed up. +# Data will be placed at "${tmp}/data/". +setup_data + +start_test + +cat <$tmp/bconcmds +@$out /dev/null +messages +@$out $tmp/log1.out +run job=$JobName yes +wait +messages +quit +END_OF_DATA + +run_bareos + +@PHP@ -S 127.0.0.1:@php_port@ -t @PROJECT_SOURCE_DIR@/../webui/public/ >"$tmp/php.out" 2>&1 & + +PHP_PID=$(echo $!) + +# run tests but stop the test run on the first error or failure + +# +# test with readonly profile resource +# +export BAREOS_WEBUI_USERNAME=readonly +export BAREOS_WEBUI_PASSWORD=readonly +export BAREOS_WEBUI_PROFILE=readonly +export BAREOS_WEBUI_TESTNAME=test_rerun_job +echo "test with readonly profile:" >>"$tmp/selenium.out" 2>&1 +@PYTHON@ @CMAKE_SOURCE_DIR@/webui/tests/selenium/webui-selenium-test.py -v SeleniumTest.test_rerun_job >>"$tmp/selenium.out" 2>&1 + +estat=$? +export estat + +kill "${PHP_PID}" + +stop_bareos + +end_test diff --git a/systemtests/tests/webui-readonly-restore/directors.ini.in b/systemtests/tests/webui-readonly-restore/directors.ini.in new file mode 100644 index 00000000000..054b346838c --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/directors.ini.in @@ -0,0 +1,81 @@ +; +; Bareos WebUI Configuration File +; +; File: /usr/local/etc/bareos-webui/directors.ini +; + +;------------------------------------------------------------------------------ +; Section localhost-dir +;------------------------------------------------------------------------------ +[localhost-dir] + +; Enable or disable section. Possible values are "yes" or "no", the default is "yes". +enabled = "yes" + +; Fill in the IP-Address or FQDN of you director. +diraddress = "localhost" + +; Default value is 9101 +dirport = @dir_port@ + +; Set catalog to explicit value if you have multiple catalogs +;catalog = "MyCatalog" + +; Set the console name and password for a dedicated pam console; +; the counterpart console-config in the director must have set +; UsePamAuthentication = yes +;pam_console_name = "admin" +;pam_console_password = "admin" + +; TLS verify peer +; Possible values: true or false +tls_verify_peer = false + +; Server can do TLS +; Possible values: true or false +server_can_do_tls = false + +; Server requires TLS +; Possible values: true or false +server_requires_tls = false + +; Client can do TLS +; Possible values: true or false +client_can_do_tls = false + +; Client requires TLS +; Possible value: true or false +client_requires_tls = false + +; Path to the certificate authority file +; E.g. ca_file = "/usr/local/etc/bareos/tls/BareosCA.crt" +;ca_file = "" + +; Path to the cert file which needs to contain the client certificate and the key in PEM encoding +; E.g. ca_file = "/usr/local/etc/bareos/tls/restricted-named-console.pem" +;cert_file = "" + +; Passphrase needed to unlock the above cert file if set +;cert_file_passphrase = "" + +; Allowed common names +; E.g. allowed_cns = "host1.example.com" +;allowed_cns = "" + +;------------------------------------------------------------------------------ +; Section another-host-dir +;------------------------------------------------------------------------------ +[another-host-dir] +enabled = "no" +diraddress = "192.168.120.1" +dirport = 9101 +;catalog = "MyCatalog" +;tls_verify_peer = false +;server_can_do_tls = false +;server_requires_tls = false +;client_can_do_tls = false +;client_requires_tls = false +;ca_file = "" +;cert_file = "" +;cert_file_passphrase = "" +;allowed_cns = "" diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in new file mode 100644 index 00000000000..479bc6fecbb --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in @@ -0,0 +1,8 @@ +Catalog { + Name = MyCatalog + #dbdriver = "@DEFAULT_DB_TYPE@" + dbdriver = "XXX_REPLACE_WITH_DATABASE_DRIVER_XXX" + dbname = "@db_name@" + dbuser = "@db_user@" + dbpassword = "@db_password@" +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in new file mode 100644 index 00000000000..470ca702035 --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in @@ -0,0 +1,7 @@ +Client { + Name = bareos-fd + Description = "Client resource of the Director itself." + Address = localhost + Password = "@fd_password@" # password for FileDaemon + FD PORT = @fd_port@ +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/console/admin.conf b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/console/admin.conf new file mode 100644 index 00000000000..fe312662e3e --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/console/admin.conf @@ -0,0 +1,17 @@ +# +# Restricted console used by bareos-webui +# +Console { + Name = admin + Password = "admin" + Profile = "webui-admin" + + + # As php does not support TLS-PSK, + # and the director has TLS enabled by default, + # we need to either disable TLS or setup + # TLS with certificates. + # + # For testing purposes we disable it here + TLS Enable = No +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in new file mode 100644 index 00000000000..d276adcb87d --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in @@ -0,0 +1,7 @@ +Console { + Name = bareos-mon + Description = "Restricted console used by tray-monitor to get the status of the director." + Password = "@mon_dir_password@" + CommandACL = status, .status + JobACL = *all* +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/console/readonly.conf b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/console/readonly.conf new file mode 100644 index 00000000000..0ff95010efd --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/console/readonly.conf @@ -0,0 +1,17 @@ +# +# Restricted console used by bareos-webui +# +Console { + Name = readonly + Password = "readonly" + Profile = "webui-readonly" + + + # As php does not support TLS-PSK, + # and the director has TLS enabled by default, + # we need to either disable TLS or setup + # TLS with certificates. + # + # For testing purposes we disable it here + TLS Enable = No +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in new file mode 100644 index 00000000000..33b3a426e3a --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in @@ -0,0 +1,27 @@ +Director { # define myself + Name = bareos-dir + QueryFile = "@scriptdir@/query.sql" + Maximum Concurrent Jobs = 10 + Password = "@dir_password@" # Console password + Messages = Daemon + Auditing = yes + + # Enable the Heartbeat if you experience connection losses + # (eg. because of your router or firewall configuration). + # Additionally the Heartbeat can be enabled in bareos-sd and bareos-fd. + # + # Heartbeat Interval = 1 min + + # remove comment in next line to load dynamic backends from specified directory + Backend Directory = @backenddir@ + + # remove comment from "Plugin Directory" to load plugins from specified directory. + # if "Plugin Names" is defined, only the specified plugins will be loaded, + # otherwise all director plugins (*-dir.so) from the "Plugin Directory". + # + # Plugin Directory = "@python_plugin_module_src_dir@" + # Plugin Names = "" + Working Directory = "@working_dir@" + Pid Directory = "@piddir@" + DirPort = @dir_port@ +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/fileset/Catalog.conf b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/fileset/Catalog.conf new file mode 100644 index 00000000000..ec1a47c971b --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/fileset/Catalog.conf @@ -0,0 +1,11 @@ +FileSet { + Name = "Catalog" + Description = "Backup the catalog dump and Bareos configuration files." + Include { + Options { + signature = MD5 + } + File = "/var/lib/bareos/bareos.sql" # database dump + File = "/usr/local/etc/bareos" # configuration + } +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in new file mode 100644 index 00000000000..c7cdc433fe1 --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in @@ -0,0 +1,11 @@ +FileSet { + Name = "Catalog" + Description = "Backup the catalog dump and Bareos configuration files." + Include { + Options { + signature = MD5 + } + File = "@working_dir@/@db_name@.sql" # database dump + File = "@confdir@" # configuration + } +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf new file mode 100644 index 00000000000..3a3336823ac --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf @@ -0,0 +1,31 @@ +FileSet { + Name = "LinuxAll" + Description = "Backup all regular filesystems, determined by filesystem type." + Include { + Options { + Signature = MD5 # calculate md5 checksum per file + One FS = No # change into other filessytems + FS Type = btrfs + FS Type = ext2 # filesystems of given types will be backed up + FS Type = ext3 # others will be ignored + FS Type = ext4 + FS Type = reiserfs + FS Type = jfs + FS Type = xfs + FS Type = zfs + } + File = / + } + # Things that usually have to be excluded + # You have to exclude /var/lib/bareos/storage + # on your bareos server + Exclude { + File = /var/lib/bareos + File = /var/lib/bareos/storage + File = /proc + File = /tmp + File = /var/tmp + File = /.journal + File = /.fsck + } +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in new file mode 100644 index 00000000000..cee45dfa3ed --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in @@ -0,0 +1,31 @@ +FileSet { + Name = "LinuxAll" + Description = "Backup all regular filesystems, determined by filesystem type." + Include { + Options { + Signature = MD5 # calculate md5 checksum per file + One FS = No # change into other filessytems + FS Type = btrfs + FS Type = ext2 # filesystems of given types will be backed up + FS Type = ext3 # others will be ignored + FS Type = ext4 + FS Type = reiserfs + FS Type = jfs + FS Type = xfs + FS Type = zfs + } + File = / + } + # Things that usually have to be excluded + # You have to exclude @archivedir@ + # on your bareos server + Exclude { + File = @working_dir@ + File = @archivedir@ + File = /proc + File = /tmp + File = /var/tmp + File = /.journal + File = /.fsck + } +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/fileset/SelfTest.conf b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/fileset/SelfTest.conf new file mode 100644 index 00000000000..a117233f531 --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/fileset/SelfTest.conf @@ -0,0 +1,11 @@ +FileSet { + Name = "SelfTest" + Description = "fileset just to backup some files for selftest" + Include { + Options { + Signature = MD5 # calculate md5 checksum per file + } + #File = "/usr/local/sbin" + File= + RunBeforeJob = "@scriptdir@/make_catalog_backup.pl MyCatalog" + + # This deletes the copy of the catalog + RunAfterJob = "@scriptdir@/delete_catalog_backup" + + # This sends the bootstrap via mail for disaster recovery. + # Should be sent to another system, please change recipient accordingly + Write Bootstrap = "|@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \" -s \"Bootstrap for Job %j\" @job_email@" # (#01) + Priority = 11 # run after main backup +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in new file mode 100644 index 00000000000..577f6f9b6bb --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in @@ -0,0 +1,11 @@ +Job { + Name = "RestoreFiles" + Description = "Standard Restore template. Only one such job is needed for all standard Jobs/Clients/Storage ..." + Type = Restore + Client = bareos-fd + FileSet = "LinuxAll" + Storage = File + Pool = Incremental + Messages = Standard + Where = @tmp@/bareos-restores +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in new file mode 100644 index 00000000000..ca1891f9620 --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in @@ -0,0 +1,5 @@ +Job { + Name = "backup-bareos-fd" + JobDefs = "DefaultJob" + Client = "bareos-fd" +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in new file mode 100644 index 00000000000..0d1c0bd04e7 --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in @@ -0,0 +1,16 @@ +JobDefs { + Name = "DefaultJob" + Type = Backup + Level = Incremental + Client = bareos-fd + FileSet = "SelfTest" # selftest fileset (#13) + Schedule = "WeeklyCycle" + Storage = File + Messages = Standard + Pool = Incremental + Priority = 10 + Write Bootstrap = "@working_dir@/%c.bsr" + Full Backup Pool = Full # write Full Backups into "Full" Pool (#05) + Differential Backup Pool = Differential # write Diff Backups into "Differential" Pool (#08) + Incremental Backup Pool = Incremental # write Incr Backups into "Incremental" Pool (#11) +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/messages/Daemon.conf.in b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/messages/Daemon.conf.in new file mode 100644 index 00000000000..ce0e5ec6778 --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/messages/Daemon.conf.in @@ -0,0 +1,9 @@ +Messages { + Name = Daemon + Description = "Message delivery for daemon messages (no job)." + mailcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos daemon message\" %r" + mail = @job_email@ = all, !skipped, !audit # (#02) + console = all, !skipped, !saved, !audit + append = "@logdir@/bareos.log" = all, !skipped, !audit + append = "@logdir@/bareos-audit.log" = audit +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/messages/Standard.conf.in b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/messages/Standard.conf.in new file mode 100644 index 00000000000..fdcc1f735e5 --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/messages/Standard.conf.in @@ -0,0 +1,11 @@ +Messages { + Name = Standard + Description = "Reasonable message delivery -- send most everything to email address and to the console." + operatorcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos: Intervention needed for %j\" %r" + mailcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos: %t %e of %c %l\" %r" + operator = @job_email@ = mount # (#03) + mail = @job_email@ = all, !skipped, !saved, !audit # (#02) + console = all, !skipped, !saved, !audit + append = "@logdir@/bareos.log" = all, !skipped, !saved, !audit + catalog = all, !skipped, !saved, !audit +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/pool/Differential.conf b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/pool/Differential.conf new file mode 100644 index 00000000000..25ce24821ab --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/pool/Differential.conf @@ -0,0 +1,10 @@ +Pool { + Name = Differential + Pool Type = Backup + Recycle = yes # Bareos can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 90 days # How long should the Differential Backups be kept? (#09) + Maximum Volume Bytes = 10G # Limit Volume size to something reasonable + Maximum Volumes = 100 # Limit number of Volumes in Pool + Label Format = "Differential-" # Volumes will be labeled "Differential-" +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/pool/Full.conf b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/pool/Full.conf new file mode 100644 index 00000000000..867fc66b483 --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/pool/Full.conf @@ -0,0 +1,10 @@ +Pool { + Name = Full + Pool Type = Backup + Recycle = yes # Bareos can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 365 days # How long should the Full Backups be kept? (#06) + Maximum Volume Bytes = 50G # Limit Volume size to something reasonable + Maximum Volumes = 100 # Limit number of Volumes in Pool + Label Format = "Full-" # Volumes will be labeled "Full-" +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/pool/Incremental.conf b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/pool/Incremental.conf new file mode 100644 index 00000000000..f4dbbab6650 --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/pool/Incremental.conf @@ -0,0 +1,10 @@ +Pool { + Name = Incremental + Pool Type = Backup + Recycle = yes # Bareos can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 30 days # How long should the Incremental Backups be kept? (#12) + Maximum Volume Bytes = 1G # Limit Volume size to something reasonable + Maximum Volumes = 100 # Limit number of Volumes in Pool + Label Format = "Incremental-" # Volumes will be labeled "Incremental-" +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/pool/Scratch.conf b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/pool/Scratch.conf new file mode 100644 index 00000000000..3a489b19871 --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/pool/Scratch.conf @@ -0,0 +1,4 @@ +Pool { + Name = Scratch + Pool Type = Scratch +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/profile/operator.conf b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/profile/operator.conf new file mode 100644 index 00000000000..6edd0166dca --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/profile/operator.conf @@ -0,0 +1,18 @@ +Profile { + Name = operator + Description = "Profile allowing normal Bareos operations." + + Command ACL = !.bvfs_clear_cache, !.exit, !.sql + Command ACL = !configure, !create, !delete, !purge, !prune, !sqlquery, !umount, !unmount + Command ACL = *all* + + Catalog ACL = *all* + Client ACL = *all* + FileSet ACL = *all* + Job ACL = *all* + Plugin Options ACL = *all* + Pool ACL = *all* + Schedule ACL = *all* + Storage ACL = *all* + Where ACL = *all* +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/profile/webui-admin.conf b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/profile/webui-admin.conf new file mode 100644 index 00000000000..860af09e4fa --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/profile/webui-admin.conf @@ -0,0 +1,15 @@ +# +# bareos-webui webui-admin profile resource +# +Profile { + Name = "webui-admin" + CommandACL = !.bvfs_clear_cache, !.exit, !.sql, !configure, !create, !delete, !purge, !prune, !sqlquery, !umount, !unmount, *all* + Job ACL = *all* + Schedule ACL = *all* + Catalog ACL = *all* + Pool ACL = *all* + Storage ACL = *all* + Client ACL = *all* + FileSet ACL = *all* + Where ACL = *all* +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/profile/webui-readonly.conf b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/profile/webui-readonly.conf new file mode 100644 index 00000000000..fde80e8d4c0 --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/profile/webui-readonly.conf @@ -0,0 +1,37 @@ +# +# bareos-webui profile resource: read-only access +# + +Profile { + Name = "webui-readonly" + + # Allow access to the following commands + CommandACL = .api, .help, use, version, status + CommandACL = list, llist + CommandACL = .clients, .jobs, .filesets, .pools, .storages, .defaults, .schedule + CommandACL = .bvfs_lsdirs, .bvfs_lsfiles, .bvfs_update, .bvfs_get_jobids, .bvfs_versions, .bvfs_restore + + # Allow access to the following job resources + Job ACL = *all* + + # Allow access to the following schedule resources + Schedule ACL = *all* + + # Allow access to the following catalog resources + Catalog ACL = *all* + + # Allow access to the following pool resources + Pool ACL = *all* + + # Allow access to the following storage resources + Storage ACL = *all* + + # Allow access to the following client resources + Client ACL = *all* + + # Allow access to the following filset resources + FileSet ACL = *all* + + # Allow access to restore to any filesystem location + Where ACL = *all* +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf new file mode 100644 index 00000000000..a2181c7db3d --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf @@ -0,0 +1,6 @@ +Schedule { + Name = "WeeklyCycle" +# Run = Full 1st sat at 21:00 # (#04) +# Run = Differential 2nd-5th sat at 21:00 # (#07) +# Run = Incremental mon-fri at 21:00 # (#10) +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf new file mode 100644 index 00000000000..49b245671cb --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf @@ -0,0 +1,5 @@ +Schedule { + Name = "WeeklyCycleAfterBackup" + Description = "This schedule does the catalog. It starts after the WeeklyCycle." +# Run = Full mon-fri at 21:10 +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/storage/File.conf.in b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/storage/File.conf.in new file mode 100644 index 00000000000..4058ddc7edc --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-dir.d/storage/File.conf.in @@ -0,0 +1,8 @@ +Storage { + Name = File + Address = @hostname@ # N.B. Use a fully qualified name here (do not use "localhost" here). + Password = "@sd_password@" + Device = FileStorage + Media Type = File + SD Port = @sd_port@ +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-fd.d/client/myself.conf.in b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-fd.d/client/myself.conf.in new file mode 100644 index 00000000000..e218bf06514 --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-fd.d/client/myself.conf.in @@ -0,0 +1,20 @@ +Client { + Name = @basename@-fd + Maximum Concurrent Jobs = 20 + + # remove comment from "Plugin Directory" to load plugins from specified directory. + # if "Plugin Names" is defined, only the specified plugins will be loaded, + # otherwise all filedaemon plugins (*-fd.so) from the "Plugin Directory". + # + # Plugin Directory = "@python_plugin_module_src_fd@" + # Plugin Names = "" + + # if compatible is set to yes, we are compatible with bacula + # if set to no, new bareos features are enabled which is the default + # compatible = yes + + Working Directory = "@working_dir@" + Pid Directory = "@piddir@" + FD Port = @fd_port@ + +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in new file mode 100644 index 00000000000..c8dc7085a45 --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in @@ -0,0 +1,5 @@ +Director { + Name = bareos-dir + Password = "@fd_password@" + Description = "Allow the configured Director to access this file daemon." +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in new file mode 100644 index 00000000000..630c3a9abd3 --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in @@ -0,0 +1,6 @@ +Director { + Name = bareos-mon + Password = "@mon_fd_password@" + Monitor = yes + Description = "Restricted Director, used by tray-monitor to get the status of this file daemon." +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-fd.d/messages/Standard.conf b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-fd.d/messages/Standard.conf new file mode 100644 index 00000000000..97788e00573 --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-fd.d/messages/Standard.conf @@ -0,0 +1,5 @@ +Messages { + Name = Standard + Director = bareos-dir = all, !skipped, !restored + Description = "Send relevant messages to the Director." +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-sd.d/device/FileStorage.conf.in b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-sd.d/device/FileStorage.conf.in new file mode 100644 index 00000000000..d7f2d1dcf19 --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-sd.d/device/FileStorage.conf.in @@ -0,0 +1,11 @@ +Device { + Name = FileStorage + Media Type = File + Archive Device = @archivedir@ + LabelMedia = yes; # lets Bareos label unlabeled media + Random Access = yes; + AutomaticMount = yes; # when device opened, read it + RemovableMedia = no; + AlwaysOpen = no; + Description = "File device. A connecting Director must have the same Name and MediaType." +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in new file mode 100644 index 00000000000..deef3360c2d --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in @@ -0,0 +1,5 @@ +Director { + Name = bareos-dir + Password = "@sd_password@" + Description = "Director, who is permitted to contact this storage daemon." +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in new file mode 100644 index 00000000000..e3cfdee6315 --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in @@ -0,0 +1,6 @@ +Director { + Name = bareos-mon + Password = "@mon_sd_password@" + Monitor = yes + Description = "Restricted Director, used by tray-monitor to get the status of this storage daemon." +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-sd.d/messages/Standard.conf b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-sd.d/messages/Standard.conf new file mode 100644 index 00000000000..468348e62fc --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-sd.d/messages/Standard.conf @@ -0,0 +1,5 @@ +Messages { + Name = Standard + Director = bareos-dir = all + Description = "Send all messages to the Director." +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in new file mode 100644 index 00000000000..3e1723fa60c --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in @@ -0,0 +1,14 @@ +Storage { + Name = bareos-sd + Maximum Concurrent Jobs = 20 + + # remove comment from "Plugin Directory" to load plugins from specified directory. + # if "Plugin Names" is defined, only the specified plugins will be loaded, + # otherwise all storage plugins (*-sd.so) from the "Plugin Directory". + # + # Plugin Directory = "@python_plugin_module_src_sd@" + # Plugin Names = "" + Working Directory = "@working_dir@" + Pid Directory = "@piddir@" + SD Port = @sd_port@ +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/bconsole.conf.in b/systemtests/tests/webui-readonly-restore/etc/bareos/bconsole.conf.in new file mode 100644 index 00000000000..ecb6ad00dce --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/bconsole.conf.in @@ -0,0 +1,10 @@ +# +# Bareos User Agent (or Console) Configuration File +# + +Director { + Name = @basename@-dir + DIRport = @dir_port@ + address = @hostname@ + Password = "@dir_password@" +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in b/systemtests/tests/webui-readonly-restore/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in new file mode 100644 index 00000000000..dd00dd9f103 --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in @@ -0,0 +1,5 @@ +Client { + Name = @basename@-fd + Address = localhost + Password = "@mon_fd_password@" # password for FileDaemon +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/tray-monitor.d/director/Director-local.conf.in b/systemtests/tests/webui-readonly-restore/etc/bareos/tray-monitor.d/director/Director-local.conf.in new file mode 100644 index 00000000000..55dae492250 --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/tray-monitor.d/director/Director-local.conf.in @@ -0,0 +1,4 @@ +Director { + Name = bareos-dir + Address = localhost +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in b/systemtests/tests/webui-readonly-restore/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in new file mode 100644 index 00000000000..cddfa253945 --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in @@ -0,0 +1,7 @@ +Monitor { + # Name to establish connections to Director Console, Storage Daemon and File Daemon. + Name = bareos-mon + # Password to access the Director + Password = "@mon_dir_password@" # password for the Directors + RefreshInterval = 30 seconds +} diff --git a/systemtests/tests/webui-readonly-restore/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in b/systemtests/tests/webui-readonly-restore/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in new file mode 100644 index 00000000000..6538f4fd248 --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in @@ -0,0 +1,5 @@ +Storage { + Name = bareos-sd + Address = localhost + Password = "@mon_sd_password@" # password for StorageDaemon +} diff --git a/systemtests/tests/webui-readonly-restore/testrunner.in b/systemtests/tests/webui-readonly-restore/testrunner.in new file mode 100755 index 00000000000..1d87a16c25a --- /dev/null +++ b/systemtests/tests/webui-readonly-restore/testrunner.in @@ -0,0 +1,62 @@ +#!/bin/sh +# +# Run a simple backup +# then restore it. +# +TestName="$(basename "$(pwd)")" +export TestName + +JobName=backup-bareos-fd +. ./environment +. ${scripts}/functions + +${scripts}/cleanup +${scripts}/setup + + +# Directory to backup. +# This directory will be created by setup_data(). +BackupDirectory="${tmp}/data" + +# Use a tgz to setup data to be backed up. +# Data will be placed at "${tmp}/data/". +setup_data + +start_test + +cat <$tmp/bconcmds +@$out /dev/null +messages +@$out $tmp/log1.out +run job=$JobName yes +wait +messages +quit +END_OF_DATA + +run_bareos + +@PHP@ -S 127.0.0.1:@php_port@ -t @PROJECT_SOURCE_DIR@/../webui/public/ >"$tmp/php.out" 2>&1 & + +PHP_PID=$(echo $!) + +# run tests but stop the test run on the first error or failure + +# +# test with readonly profile resource +# +export BAREOS_WEBUI_USERNAME=readonly +export BAREOS_WEBUI_PASSWORD=readonly +export BAREOS_WEBUI_PROFILE=readonly +export BAREOS_WEBUI_TESTNAME=test_restore +echo "test with readonly profile:" >>"$tmp/selenium.out" 2>&1 +@PYTHON@ @CMAKE_SOURCE_DIR@/webui/tests/selenium/webui-selenium-test.py -v SeleniumTest.test_restore >>"$tmp/selenium.out" 2>&1 + +estat=$? +export estat + +kill "${PHP_PID}" + +stop_bareos + +end_test diff --git a/systemtests/tests/webui-readonly-run-custom-job/directors.ini.in b/systemtests/tests/webui-readonly-run-custom-job/directors.ini.in new file mode 100644 index 00000000000..054b346838c --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/directors.ini.in @@ -0,0 +1,81 @@ +; +; Bareos WebUI Configuration File +; +; File: /usr/local/etc/bareos-webui/directors.ini +; + +;------------------------------------------------------------------------------ +; Section localhost-dir +;------------------------------------------------------------------------------ +[localhost-dir] + +; Enable or disable section. Possible values are "yes" or "no", the default is "yes". +enabled = "yes" + +; Fill in the IP-Address or FQDN of you director. +diraddress = "localhost" + +; Default value is 9101 +dirport = @dir_port@ + +; Set catalog to explicit value if you have multiple catalogs +;catalog = "MyCatalog" + +; Set the console name and password for a dedicated pam console; +; the counterpart console-config in the director must have set +; UsePamAuthentication = yes +;pam_console_name = "admin" +;pam_console_password = "admin" + +; TLS verify peer +; Possible values: true or false +tls_verify_peer = false + +; Server can do TLS +; Possible values: true or false +server_can_do_tls = false + +; Server requires TLS +; Possible values: true or false +server_requires_tls = false + +; Client can do TLS +; Possible values: true or false +client_can_do_tls = false + +; Client requires TLS +; Possible value: true or false +client_requires_tls = false + +; Path to the certificate authority file +; E.g. ca_file = "/usr/local/etc/bareos/tls/BareosCA.crt" +;ca_file = "" + +; Path to the cert file which needs to contain the client certificate and the key in PEM encoding +; E.g. ca_file = "/usr/local/etc/bareos/tls/restricted-named-console.pem" +;cert_file = "" + +; Passphrase needed to unlock the above cert file if set +;cert_file_passphrase = "" + +; Allowed common names +; E.g. allowed_cns = "host1.example.com" +;allowed_cns = "" + +;------------------------------------------------------------------------------ +; Section another-host-dir +;------------------------------------------------------------------------------ +[another-host-dir] +enabled = "no" +diraddress = "192.168.120.1" +dirport = 9101 +;catalog = "MyCatalog" +;tls_verify_peer = false +;server_can_do_tls = false +;server_requires_tls = false +;client_can_do_tls = false +;client_requires_tls = false +;ca_file = "" +;cert_file = "" +;cert_file_passphrase = "" +;allowed_cns = "" diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in new file mode 100644 index 00000000000..479bc6fecbb --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in @@ -0,0 +1,8 @@ +Catalog { + Name = MyCatalog + #dbdriver = "@DEFAULT_DB_TYPE@" + dbdriver = "XXX_REPLACE_WITH_DATABASE_DRIVER_XXX" + dbname = "@db_name@" + dbuser = "@db_user@" + dbpassword = "@db_password@" +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in new file mode 100644 index 00000000000..470ca702035 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in @@ -0,0 +1,7 @@ +Client { + Name = bareos-fd + Description = "Client resource of the Director itself." + Address = localhost + Password = "@fd_password@" # password for FileDaemon + FD PORT = @fd_port@ +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/console/admin.conf b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/console/admin.conf new file mode 100644 index 00000000000..fe312662e3e --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/console/admin.conf @@ -0,0 +1,17 @@ +# +# Restricted console used by bareos-webui +# +Console { + Name = admin + Password = "admin" + Profile = "webui-admin" + + + # As php does not support TLS-PSK, + # and the director has TLS enabled by default, + # we need to either disable TLS or setup + # TLS with certificates. + # + # For testing purposes we disable it here + TLS Enable = No +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in new file mode 100644 index 00000000000..d276adcb87d --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in @@ -0,0 +1,7 @@ +Console { + Name = bareos-mon + Description = "Restricted console used by tray-monitor to get the status of the director." + Password = "@mon_dir_password@" + CommandACL = status, .status + JobACL = *all* +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/console/readonly.conf b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/console/readonly.conf new file mode 100644 index 00000000000..0ff95010efd --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/console/readonly.conf @@ -0,0 +1,17 @@ +# +# Restricted console used by bareos-webui +# +Console { + Name = readonly + Password = "readonly" + Profile = "webui-readonly" + + + # As php does not support TLS-PSK, + # and the director has TLS enabled by default, + # we need to either disable TLS or setup + # TLS with certificates. + # + # For testing purposes we disable it here + TLS Enable = No +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in new file mode 100644 index 00000000000..33b3a426e3a --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in @@ -0,0 +1,27 @@ +Director { # define myself + Name = bareos-dir + QueryFile = "@scriptdir@/query.sql" + Maximum Concurrent Jobs = 10 + Password = "@dir_password@" # Console password + Messages = Daemon + Auditing = yes + + # Enable the Heartbeat if you experience connection losses + # (eg. because of your router or firewall configuration). + # Additionally the Heartbeat can be enabled in bareos-sd and bareos-fd. + # + # Heartbeat Interval = 1 min + + # remove comment in next line to load dynamic backends from specified directory + Backend Directory = @backenddir@ + + # remove comment from "Plugin Directory" to load plugins from specified directory. + # if "Plugin Names" is defined, only the specified plugins will be loaded, + # otherwise all director plugins (*-dir.so) from the "Plugin Directory". + # + # Plugin Directory = "@python_plugin_module_src_dir@" + # Plugin Names = "" + Working Directory = "@working_dir@" + Pid Directory = "@piddir@" + DirPort = @dir_port@ +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf new file mode 100644 index 00000000000..ec1a47c971b --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf @@ -0,0 +1,11 @@ +FileSet { + Name = "Catalog" + Description = "Backup the catalog dump and Bareos configuration files." + Include { + Options { + signature = MD5 + } + File = "/var/lib/bareos/bareos.sql" # database dump + File = "/usr/local/etc/bareos" # configuration + } +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in new file mode 100644 index 00000000000..c7cdc433fe1 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in @@ -0,0 +1,11 @@ +FileSet { + Name = "Catalog" + Description = "Backup the catalog dump and Bareos configuration files." + Include { + Options { + signature = MD5 + } + File = "@working_dir@/@db_name@.sql" # database dump + File = "@confdir@" # configuration + } +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf new file mode 100644 index 00000000000..3a3336823ac --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf @@ -0,0 +1,31 @@ +FileSet { + Name = "LinuxAll" + Description = "Backup all regular filesystems, determined by filesystem type." + Include { + Options { + Signature = MD5 # calculate md5 checksum per file + One FS = No # change into other filessytems + FS Type = btrfs + FS Type = ext2 # filesystems of given types will be backed up + FS Type = ext3 # others will be ignored + FS Type = ext4 + FS Type = reiserfs + FS Type = jfs + FS Type = xfs + FS Type = zfs + } + File = / + } + # Things that usually have to be excluded + # You have to exclude /var/lib/bareos/storage + # on your bareos server + Exclude { + File = /var/lib/bareos + File = /var/lib/bareos/storage + File = /proc + File = /tmp + File = /var/tmp + File = /.journal + File = /.fsck + } +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in new file mode 100644 index 00000000000..cee45dfa3ed --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in @@ -0,0 +1,31 @@ +FileSet { + Name = "LinuxAll" + Description = "Backup all regular filesystems, determined by filesystem type." + Include { + Options { + Signature = MD5 # calculate md5 checksum per file + One FS = No # change into other filessytems + FS Type = btrfs + FS Type = ext2 # filesystems of given types will be backed up + FS Type = ext3 # others will be ignored + FS Type = ext4 + FS Type = reiserfs + FS Type = jfs + FS Type = xfs + FS Type = zfs + } + File = / + } + # Things that usually have to be excluded + # You have to exclude @archivedir@ + # on your bareos server + Exclude { + File = @working_dir@ + File = @archivedir@ + File = /proc + File = /tmp + File = /var/tmp + File = /.journal + File = /.fsck + } +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/fileset/SelfTest.conf b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/fileset/SelfTest.conf new file mode 100644 index 00000000000..a117233f531 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/fileset/SelfTest.conf @@ -0,0 +1,11 @@ +FileSet { + Name = "SelfTest" + Description = "fileset just to backup some files for selftest" + Include { + Options { + Signature = MD5 # calculate md5 checksum per file + } + #File = "/usr/local/sbin" + File= + RunBeforeJob = "@scriptdir@/make_catalog_backup.pl MyCatalog" + + # This deletes the copy of the catalog + RunAfterJob = "@scriptdir@/delete_catalog_backup" + + # This sends the bootstrap via mail for disaster recovery. + # Should be sent to another system, please change recipient accordingly + Write Bootstrap = "|@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \" -s \"Bootstrap for Job %j\" @job_email@" # (#01) + Priority = 11 # run after main backup +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in new file mode 100644 index 00000000000..577f6f9b6bb --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in @@ -0,0 +1,11 @@ +Job { + Name = "RestoreFiles" + Description = "Standard Restore template. Only one such job is needed for all standard Jobs/Clients/Storage ..." + Type = Restore + Client = bareos-fd + FileSet = "LinuxAll" + Storage = File + Pool = Incremental + Messages = Standard + Where = @tmp@/bareos-restores +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in new file mode 100644 index 00000000000..ca1891f9620 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in @@ -0,0 +1,5 @@ +Job { + Name = "backup-bareos-fd" + JobDefs = "DefaultJob" + Client = "bareos-fd" +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in new file mode 100644 index 00000000000..0d1c0bd04e7 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in @@ -0,0 +1,16 @@ +JobDefs { + Name = "DefaultJob" + Type = Backup + Level = Incremental + Client = bareos-fd + FileSet = "SelfTest" # selftest fileset (#13) + Schedule = "WeeklyCycle" + Storage = File + Messages = Standard + Pool = Incremental + Priority = 10 + Write Bootstrap = "@working_dir@/%c.bsr" + Full Backup Pool = Full # write Full Backups into "Full" Pool (#05) + Differential Backup Pool = Differential # write Diff Backups into "Differential" Pool (#08) + Incremental Backup Pool = Incremental # write Incr Backups into "Incremental" Pool (#11) +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/messages/Daemon.conf.in b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/messages/Daemon.conf.in new file mode 100644 index 00000000000..ce0e5ec6778 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/messages/Daemon.conf.in @@ -0,0 +1,9 @@ +Messages { + Name = Daemon + Description = "Message delivery for daemon messages (no job)." + mailcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos daemon message\" %r" + mail = @job_email@ = all, !skipped, !audit # (#02) + console = all, !skipped, !saved, !audit + append = "@logdir@/bareos.log" = all, !skipped, !audit + append = "@logdir@/bareos-audit.log" = audit +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/messages/Standard.conf.in b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/messages/Standard.conf.in new file mode 100644 index 00000000000..fdcc1f735e5 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/messages/Standard.conf.in @@ -0,0 +1,11 @@ +Messages { + Name = Standard + Description = "Reasonable message delivery -- send most everything to email address and to the console." + operatorcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos: Intervention needed for %j\" %r" + mailcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos: %t %e of %c %l\" %r" + operator = @job_email@ = mount # (#03) + mail = @job_email@ = all, !skipped, !saved, !audit # (#02) + console = all, !skipped, !saved, !audit + append = "@logdir@/bareos.log" = all, !skipped, !saved, !audit + catalog = all, !skipped, !saved, !audit +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/pool/Differential.conf b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/pool/Differential.conf new file mode 100644 index 00000000000..25ce24821ab --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/pool/Differential.conf @@ -0,0 +1,10 @@ +Pool { + Name = Differential + Pool Type = Backup + Recycle = yes # Bareos can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 90 days # How long should the Differential Backups be kept? (#09) + Maximum Volume Bytes = 10G # Limit Volume size to something reasonable + Maximum Volumes = 100 # Limit number of Volumes in Pool + Label Format = "Differential-" # Volumes will be labeled "Differential-" +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/pool/Full.conf b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/pool/Full.conf new file mode 100644 index 00000000000..867fc66b483 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/pool/Full.conf @@ -0,0 +1,10 @@ +Pool { + Name = Full + Pool Type = Backup + Recycle = yes # Bareos can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 365 days # How long should the Full Backups be kept? (#06) + Maximum Volume Bytes = 50G # Limit Volume size to something reasonable + Maximum Volumes = 100 # Limit number of Volumes in Pool + Label Format = "Full-" # Volumes will be labeled "Full-" +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/pool/Incremental.conf b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/pool/Incremental.conf new file mode 100644 index 00000000000..f4dbbab6650 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/pool/Incremental.conf @@ -0,0 +1,10 @@ +Pool { + Name = Incremental + Pool Type = Backup + Recycle = yes # Bareos can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 30 days # How long should the Incremental Backups be kept? (#12) + Maximum Volume Bytes = 1G # Limit Volume size to something reasonable + Maximum Volumes = 100 # Limit number of Volumes in Pool + Label Format = "Incremental-" # Volumes will be labeled "Incremental-" +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/pool/Scratch.conf b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/pool/Scratch.conf new file mode 100644 index 00000000000..3a489b19871 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/pool/Scratch.conf @@ -0,0 +1,4 @@ +Pool { + Name = Scratch + Pool Type = Scratch +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/profile/operator.conf b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/profile/operator.conf new file mode 100644 index 00000000000..6edd0166dca --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/profile/operator.conf @@ -0,0 +1,18 @@ +Profile { + Name = operator + Description = "Profile allowing normal Bareos operations." + + Command ACL = !.bvfs_clear_cache, !.exit, !.sql + Command ACL = !configure, !create, !delete, !purge, !prune, !sqlquery, !umount, !unmount + Command ACL = *all* + + Catalog ACL = *all* + Client ACL = *all* + FileSet ACL = *all* + Job ACL = *all* + Plugin Options ACL = *all* + Pool ACL = *all* + Schedule ACL = *all* + Storage ACL = *all* + Where ACL = *all* +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/profile/webui-admin.conf b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/profile/webui-admin.conf new file mode 100644 index 00000000000..860af09e4fa --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/profile/webui-admin.conf @@ -0,0 +1,15 @@ +# +# bareos-webui webui-admin profile resource +# +Profile { + Name = "webui-admin" + CommandACL = !.bvfs_clear_cache, !.exit, !.sql, !configure, !create, !delete, !purge, !prune, !sqlquery, !umount, !unmount, *all* + Job ACL = *all* + Schedule ACL = *all* + Catalog ACL = *all* + Pool ACL = *all* + Storage ACL = *all* + Client ACL = *all* + FileSet ACL = *all* + Where ACL = *all* +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/profile/webui-readonly.conf b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/profile/webui-readonly.conf new file mode 100644 index 00000000000..fde80e8d4c0 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/profile/webui-readonly.conf @@ -0,0 +1,37 @@ +# +# bareos-webui profile resource: read-only access +# + +Profile { + Name = "webui-readonly" + + # Allow access to the following commands + CommandACL = .api, .help, use, version, status + CommandACL = list, llist + CommandACL = .clients, .jobs, .filesets, .pools, .storages, .defaults, .schedule + CommandACL = .bvfs_lsdirs, .bvfs_lsfiles, .bvfs_update, .bvfs_get_jobids, .bvfs_versions, .bvfs_restore + + # Allow access to the following job resources + Job ACL = *all* + + # Allow access to the following schedule resources + Schedule ACL = *all* + + # Allow access to the following catalog resources + Catalog ACL = *all* + + # Allow access to the following pool resources + Pool ACL = *all* + + # Allow access to the following storage resources + Storage ACL = *all* + + # Allow access to the following client resources + Client ACL = *all* + + # Allow access to the following filset resources + FileSet ACL = *all* + + # Allow access to restore to any filesystem location + Where ACL = *all* +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf new file mode 100644 index 00000000000..a2181c7db3d --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf @@ -0,0 +1,6 @@ +Schedule { + Name = "WeeklyCycle" +# Run = Full 1st sat at 21:00 # (#04) +# Run = Differential 2nd-5th sat at 21:00 # (#07) +# Run = Incremental mon-fri at 21:00 # (#10) +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf new file mode 100644 index 00000000000..49b245671cb --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf @@ -0,0 +1,5 @@ +Schedule { + Name = "WeeklyCycleAfterBackup" + Description = "This schedule does the catalog. It starts after the WeeklyCycle." +# Run = Full mon-fri at 21:10 +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/storage/File.conf.in b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/storage/File.conf.in new file mode 100644 index 00000000000..4058ddc7edc --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-dir.d/storage/File.conf.in @@ -0,0 +1,8 @@ +Storage { + Name = File + Address = @hostname@ # N.B. Use a fully qualified name here (do not use "localhost" here). + Password = "@sd_password@" + Device = FileStorage + Media Type = File + SD Port = @sd_port@ +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-fd.d/client/myself.conf.in b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-fd.d/client/myself.conf.in new file mode 100644 index 00000000000..e218bf06514 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-fd.d/client/myself.conf.in @@ -0,0 +1,20 @@ +Client { + Name = @basename@-fd + Maximum Concurrent Jobs = 20 + + # remove comment from "Plugin Directory" to load plugins from specified directory. + # if "Plugin Names" is defined, only the specified plugins will be loaded, + # otherwise all filedaemon plugins (*-fd.so) from the "Plugin Directory". + # + # Plugin Directory = "@python_plugin_module_src_fd@" + # Plugin Names = "" + + # if compatible is set to yes, we are compatible with bacula + # if set to no, new bareos features are enabled which is the default + # compatible = yes + + Working Directory = "@working_dir@" + Pid Directory = "@piddir@" + FD Port = @fd_port@ + +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in new file mode 100644 index 00000000000..c8dc7085a45 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in @@ -0,0 +1,5 @@ +Director { + Name = bareos-dir + Password = "@fd_password@" + Description = "Allow the configured Director to access this file daemon." +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in new file mode 100644 index 00000000000..630c3a9abd3 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in @@ -0,0 +1,6 @@ +Director { + Name = bareos-mon + Password = "@mon_fd_password@" + Monitor = yes + Description = "Restricted Director, used by tray-monitor to get the status of this file daemon." +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-fd.d/messages/Standard.conf b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-fd.d/messages/Standard.conf new file mode 100644 index 00000000000..97788e00573 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-fd.d/messages/Standard.conf @@ -0,0 +1,5 @@ +Messages { + Name = Standard + Director = bareos-dir = all, !skipped, !restored + Description = "Send relevant messages to the Director." +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-sd.d/device/FileStorage.conf.in b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-sd.d/device/FileStorage.conf.in new file mode 100644 index 00000000000..d7f2d1dcf19 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-sd.d/device/FileStorage.conf.in @@ -0,0 +1,11 @@ +Device { + Name = FileStorage + Media Type = File + Archive Device = @archivedir@ + LabelMedia = yes; # lets Bareos label unlabeled media + Random Access = yes; + AutomaticMount = yes; # when device opened, read it + RemovableMedia = no; + AlwaysOpen = no; + Description = "File device. A connecting Director must have the same Name and MediaType." +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in new file mode 100644 index 00000000000..deef3360c2d --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in @@ -0,0 +1,5 @@ +Director { + Name = bareos-dir + Password = "@sd_password@" + Description = "Director, who is permitted to contact this storage daemon." +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in new file mode 100644 index 00000000000..e3cfdee6315 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in @@ -0,0 +1,6 @@ +Director { + Name = bareos-mon + Password = "@mon_sd_password@" + Monitor = yes + Description = "Restricted Director, used by tray-monitor to get the status of this storage daemon." +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-sd.d/messages/Standard.conf b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-sd.d/messages/Standard.conf new file mode 100644 index 00000000000..468348e62fc --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-sd.d/messages/Standard.conf @@ -0,0 +1,5 @@ +Messages { + Name = Standard + Director = bareos-dir = all + Description = "Send all messages to the Director." +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in new file mode 100644 index 00000000000..3e1723fa60c --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in @@ -0,0 +1,14 @@ +Storage { + Name = bareos-sd + Maximum Concurrent Jobs = 20 + + # remove comment from "Plugin Directory" to load plugins from specified directory. + # if "Plugin Names" is defined, only the specified plugins will be loaded, + # otherwise all storage plugins (*-sd.so) from the "Plugin Directory". + # + # Plugin Directory = "@python_plugin_module_src_sd@" + # Plugin Names = "" + Working Directory = "@working_dir@" + Pid Directory = "@piddir@" + SD Port = @sd_port@ +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bconsole.conf.in b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bconsole.conf.in new file mode 100644 index 00000000000..ecb6ad00dce --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/bconsole.conf.in @@ -0,0 +1,10 @@ +# +# Bareos User Agent (or Console) Configuration File +# + +Director { + Name = @basename@-dir + DIRport = @dir_port@ + address = @hostname@ + Password = "@dir_password@" +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in new file mode 100644 index 00000000000..dd00dd9f103 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in @@ -0,0 +1,5 @@ +Client { + Name = @basename@-fd + Address = localhost + Password = "@mon_fd_password@" # password for FileDaemon +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/tray-monitor.d/director/Director-local.conf.in b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/tray-monitor.d/director/Director-local.conf.in new file mode 100644 index 00000000000..55dae492250 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/tray-monitor.d/director/Director-local.conf.in @@ -0,0 +1,4 @@ +Director { + Name = bareos-dir + Address = localhost +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in new file mode 100644 index 00000000000..cddfa253945 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in @@ -0,0 +1,7 @@ +Monitor { + # Name to establish connections to Director Console, Storage Daemon and File Daemon. + Name = bareos-mon + # Password to access the Director + Password = "@mon_dir_password@" # password for the Directors + RefreshInterval = 30 seconds +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in new file mode 100644 index 00000000000..6538f4fd248 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in @@ -0,0 +1,5 @@ +Storage { + Name = bareos-sd + Address = localhost + Password = "@mon_sd_password@" # password for StorageDaemon +} diff --git a/systemtests/tests/webui-readonly-run-custom-job/testrunner.in b/systemtests/tests/webui-readonly-run-custom-job/testrunner.in new file mode 100755 index 00000000000..f24e3a231e1 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-custom-job/testrunner.in @@ -0,0 +1,62 @@ +#!/bin/sh +# +# Run a simple backup +# then restore it. +# +TestName="$(basename "$(pwd)")" +export TestName + +JobName=backup-bareos-fd +. ./environment +. ${scripts}/functions + +${scripts}/cleanup +${scripts}/setup + + +# Directory to backup. +# This directory will be created by setup_data(). +BackupDirectory="${tmp}/data" + +# Use a tgz to setup data to be backed up. +# Data will be placed at "${tmp}/data/". +setup_data + +start_test + +cat <$tmp/bconcmds +@$out /dev/null +messages +@$out $tmp/log1.out +run job=$JobName yes +wait +messages +quit +END_OF_DATA + +run_bareos + +@PHP@ -S 127.0.0.1:@php_port@ -t @PROJECT_SOURCE_DIR@/../webui/public/ >"$tmp/php.out" 2>&1 & + +PHP_PID=$(echo $!) + +# run tests but stop the test run on the first error or failure + +# +# test with readonly profile resource +# +export BAREOS_WEBUI_USERNAME=readonly +export BAREOS_WEBUI_PASSWORD=readonly +export BAREOS_WEBUI_PROFILE=readonly +export BAREOS_WEBUI_TESTNAME=test_run_configured_job +echo "test with readonly profile:" >>"$tmp/selenium.out" 2>&1 +@PYTHON@ @CMAKE_SOURCE_DIR@/webui/tests/selenium/webui-selenium-test.py -v SeleniumTest.test_run_configured_job >>"$tmp/selenium.out" 2>&1 + +estat=$? +export estat + +kill "${PHP_PID}" + +stop_bareos + +end_test diff --git a/systemtests/tests/webui-readonly-run-job/directors.ini.in b/systemtests/tests/webui-readonly-run-job/directors.ini.in new file mode 100644 index 00000000000..054b346838c --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/directors.ini.in @@ -0,0 +1,81 @@ +; +; Bareos WebUI Configuration File +; +; File: /usr/local/etc/bareos-webui/directors.ini +; + +;------------------------------------------------------------------------------ +; Section localhost-dir +;------------------------------------------------------------------------------ +[localhost-dir] + +; Enable or disable section. Possible values are "yes" or "no", the default is "yes". +enabled = "yes" + +; Fill in the IP-Address or FQDN of you director. +diraddress = "localhost" + +; Default value is 9101 +dirport = @dir_port@ + +; Set catalog to explicit value if you have multiple catalogs +;catalog = "MyCatalog" + +; Set the console name and password for a dedicated pam console; +; the counterpart console-config in the director must have set +; UsePamAuthentication = yes +;pam_console_name = "admin" +;pam_console_password = "admin" + +; TLS verify peer +; Possible values: true or false +tls_verify_peer = false + +; Server can do TLS +; Possible values: true or false +server_can_do_tls = false + +; Server requires TLS +; Possible values: true or false +server_requires_tls = false + +; Client can do TLS +; Possible values: true or false +client_can_do_tls = false + +; Client requires TLS +; Possible value: true or false +client_requires_tls = false + +; Path to the certificate authority file +; E.g. ca_file = "/usr/local/etc/bareos/tls/BareosCA.crt" +;ca_file = "" + +; Path to the cert file which needs to contain the client certificate and the key in PEM encoding +; E.g. ca_file = "/usr/local/etc/bareos/tls/restricted-named-console.pem" +;cert_file = "" + +; Passphrase needed to unlock the above cert file if set +;cert_file_passphrase = "" + +; Allowed common names +; E.g. allowed_cns = "host1.example.com" +;allowed_cns = "" + +;------------------------------------------------------------------------------ +; Section another-host-dir +;------------------------------------------------------------------------------ +[another-host-dir] +enabled = "no" +diraddress = "192.168.120.1" +dirport = 9101 +;catalog = "MyCatalog" +;tls_verify_peer = false +;server_can_do_tls = false +;server_requires_tls = false +;client_can_do_tls = false +;client_requires_tls = false +;ca_file = "" +;cert_file = "" +;cert_file_passphrase = "" +;allowed_cns = "" diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in new file mode 100644 index 00000000000..479bc6fecbb --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in @@ -0,0 +1,8 @@ +Catalog { + Name = MyCatalog + #dbdriver = "@DEFAULT_DB_TYPE@" + dbdriver = "XXX_REPLACE_WITH_DATABASE_DRIVER_XXX" + dbname = "@db_name@" + dbuser = "@db_user@" + dbpassword = "@db_password@" +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in new file mode 100644 index 00000000000..470ca702035 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in @@ -0,0 +1,7 @@ +Client { + Name = bareos-fd + Description = "Client resource of the Director itself." + Address = localhost + Password = "@fd_password@" # password for FileDaemon + FD PORT = @fd_port@ +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/console/admin.conf b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/console/admin.conf new file mode 100644 index 00000000000..fe312662e3e --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/console/admin.conf @@ -0,0 +1,17 @@ +# +# Restricted console used by bareos-webui +# +Console { + Name = admin + Password = "admin" + Profile = "webui-admin" + + + # As php does not support TLS-PSK, + # and the director has TLS enabled by default, + # we need to either disable TLS or setup + # TLS with certificates. + # + # For testing purposes we disable it here + TLS Enable = No +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in new file mode 100644 index 00000000000..d276adcb87d --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/console/bareos-mon.conf.in @@ -0,0 +1,7 @@ +Console { + Name = bareos-mon + Description = "Restricted console used by tray-monitor to get the status of the director." + Password = "@mon_dir_password@" + CommandACL = status, .status + JobACL = *all* +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/console/readonly.conf b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/console/readonly.conf new file mode 100644 index 00000000000..0ff95010efd --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/console/readonly.conf @@ -0,0 +1,17 @@ +# +# Restricted console used by bareos-webui +# +Console { + Name = readonly + Password = "readonly" + Profile = "webui-readonly" + + + # As php does not support TLS-PSK, + # and the director has TLS enabled by default, + # we need to either disable TLS or setup + # TLS with certificates. + # + # For testing purposes we disable it here + TLS Enable = No +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in new file mode 100644 index 00000000000..33b3a426e3a --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in @@ -0,0 +1,27 @@ +Director { # define myself + Name = bareos-dir + QueryFile = "@scriptdir@/query.sql" + Maximum Concurrent Jobs = 10 + Password = "@dir_password@" # Console password + Messages = Daemon + Auditing = yes + + # Enable the Heartbeat if you experience connection losses + # (eg. because of your router or firewall configuration). + # Additionally the Heartbeat can be enabled in bareos-sd and bareos-fd. + # + # Heartbeat Interval = 1 min + + # remove comment in next line to load dynamic backends from specified directory + Backend Directory = @backenddir@ + + # remove comment from "Plugin Directory" to load plugins from specified directory. + # if "Plugin Names" is defined, only the specified plugins will be loaded, + # otherwise all director plugins (*-dir.so) from the "Plugin Directory". + # + # Plugin Directory = "@python_plugin_module_src_dir@" + # Plugin Names = "" + Working Directory = "@working_dir@" + Pid Directory = "@piddir@" + DirPort = @dir_port@ +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf new file mode 100644 index 00000000000..ec1a47c971b --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf @@ -0,0 +1,11 @@ +FileSet { + Name = "Catalog" + Description = "Backup the catalog dump and Bareos configuration files." + Include { + Options { + signature = MD5 + } + File = "/var/lib/bareos/bareos.sql" # database dump + File = "/usr/local/etc/bareos" # configuration + } +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in new file mode 100644 index 00000000000..c7cdc433fe1 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in @@ -0,0 +1,11 @@ +FileSet { + Name = "Catalog" + Description = "Backup the catalog dump and Bareos configuration files." + Include { + Options { + signature = MD5 + } + File = "@working_dir@/@db_name@.sql" # database dump + File = "@confdir@" # configuration + } +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf new file mode 100644 index 00000000000..3a3336823ac --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf @@ -0,0 +1,31 @@ +FileSet { + Name = "LinuxAll" + Description = "Backup all regular filesystems, determined by filesystem type." + Include { + Options { + Signature = MD5 # calculate md5 checksum per file + One FS = No # change into other filessytems + FS Type = btrfs + FS Type = ext2 # filesystems of given types will be backed up + FS Type = ext3 # others will be ignored + FS Type = ext4 + FS Type = reiserfs + FS Type = jfs + FS Type = xfs + FS Type = zfs + } + File = / + } + # Things that usually have to be excluded + # You have to exclude /var/lib/bareos/storage + # on your bareos server + Exclude { + File = /var/lib/bareos + File = /var/lib/bareos/storage + File = /proc + File = /tmp + File = /var/tmp + File = /.journal + File = /.fsck + } +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in new file mode 100644 index 00000000000..cee45dfa3ed --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/fileset/LinuxAll.conf.in @@ -0,0 +1,31 @@ +FileSet { + Name = "LinuxAll" + Description = "Backup all regular filesystems, determined by filesystem type." + Include { + Options { + Signature = MD5 # calculate md5 checksum per file + One FS = No # change into other filessytems + FS Type = btrfs + FS Type = ext2 # filesystems of given types will be backed up + FS Type = ext3 # others will be ignored + FS Type = ext4 + FS Type = reiserfs + FS Type = jfs + FS Type = xfs + FS Type = zfs + } + File = / + } + # Things that usually have to be excluded + # You have to exclude @archivedir@ + # on your bareos server + Exclude { + File = @working_dir@ + File = @archivedir@ + File = /proc + File = /tmp + File = /var/tmp + File = /.journal + File = /.fsck + } +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/fileset/SelfTest.conf b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/fileset/SelfTest.conf new file mode 100644 index 00000000000..a117233f531 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/fileset/SelfTest.conf @@ -0,0 +1,11 @@ +FileSet { + Name = "SelfTest" + Description = "fileset just to backup some files for selftest" + Include { + Options { + Signature = MD5 # calculate md5 checksum per file + } + #File = "/usr/local/sbin" + File= + RunBeforeJob = "@scriptdir@/make_catalog_backup.pl MyCatalog" + + # This deletes the copy of the catalog + RunAfterJob = "@scriptdir@/delete_catalog_backup" + + # This sends the bootstrap via mail for disaster recovery. + # Should be sent to another system, please change recipient accordingly + Write Bootstrap = "|@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \" -s \"Bootstrap for Job %j\" @job_email@" # (#01) + Priority = 11 # run after main backup +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in new file mode 100644 index 00000000000..577f6f9b6bb --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in @@ -0,0 +1,11 @@ +Job { + Name = "RestoreFiles" + Description = "Standard Restore template. Only one such job is needed for all standard Jobs/Clients/Storage ..." + Type = Restore + Client = bareos-fd + FileSet = "LinuxAll" + Storage = File + Pool = Incremental + Messages = Standard + Where = @tmp@/bareos-restores +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in new file mode 100644 index 00000000000..ca1891f9620 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in @@ -0,0 +1,5 @@ +Job { + Name = "backup-bareos-fd" + JobDefs = "DefaultJob" + Client = "bareos-fd" +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in new file mode 100644 index 00000000000..0d1c0bd04e7 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in @@ -0,0 +1,16 @@ +JobDefs { + Name = "DefaultJob" + Type = Backup + Level = Incremental + Client = bareos-fd + FileSet = "SelfTest" # selftest fileset (#13) + Schedule = "WeeklyCycle" + Storage = File + Messages = Standard + Pool = Incremental + Priority = 10 + Write Bootstrap = "@working_dir@/%c.bsr" + Full Backup Pool = Full # write Full Backups into "Full" Pool (#05) + Differential Backup Pool = Differential # write Diff Backups into "Differential" Pool (#08) + Incremental Backup Pool = Incremental # write Incr Backups into "Incremental" Pool (#11) +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/messages/Daemon.conf.in b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/messages/Daemon.conf.in new file mode 100644 index 00000000000..ce0e5ec6778 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/messages/Daemon.conf.in @@ -0,0 +1,9 @@ +Messages { + Name = Daemon + Description = "Message delivery for daemon messages (no job)." + mailcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos daemon message\" %r" + mail = @job_email@ = all, !skipped, !audit # (#02) + console = all, !skipped, !saved, !audit + append = "@logdir@/bareos.log" = all, !skipped, !audit + append = "@logdir@/bareos-audit.log" = audit +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/messages/Standard.conf.in b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/messages/Standard.conf.in new file mode 100644 index 00000000000..fdcc1f735e5 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/messages/Standard.conf.in @@ -0,0 +1,11 @@ +Messages { + Name = Standard + Description = "Reasonable message delivery -- send most everything to email address and to the console." + operatorcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos: Intervention needed for %j\" %r" + mailcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos: %t %e of %c %l\" %r" + operator = @job_email@ = mount # (#03) + mail = @job_email@ = all, !skipped, !saved, !audit # (#02) + console = all, !skipped, !saved, !audit + append = "@logdir@/bareos.log" = all, !skipped, !saved, !audit + catalog = all, !skipped, !saved, !audit +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/pool/Differential.conf b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/pool/Differential.conf new file mode 100644 index 00000000000..25ce24821ab --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/pool/Differential.conf @@ -0,0 +1,10 @@ +Pool { + Name = Differential + Pool Type = Backup + Recycle = yes # Bareos can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 90 days # How long should the Differential Backups be kept? (#09) + Maximum Volume Bytes = 10G # Limit Volume size to something reasonable + Maximum Volumes = 100 # Limit number of Volumes in Pool + Label Format = "Differential-" # Volumes will be labeled "Differential-" +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/pool/Full.conf b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/pool/Full.conf new file mode 100644 index 00000000000..867fc66b483 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/pool/Full.conf @@ -0,0 +1,10 @@ +Pool { + Name = Full + Pool Type = Backup + Recycle = yes # Bareos can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 365 days # How long should the Full Backups be kept? (#06) + Maximum Volume Bytes = 50G # Limit Volume size to something reasonable + Maximum Volumes = 100 # Limit number of Volumes in Pool + Label Format = "Full-" # Volumes will be labeled "Full-" +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/pool/Incremental.conf b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/pool/Incremental.conf new file mode 100644 index 00000000000..f4dbbab6650 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/pool/Incremental.conf @@ -0,0 +1,10 @@ +Pool { + Name = Incremental + Pool Type = Backup + Recycle = yes # Bareos can automatically recycle Volumes + AutoPrune = yes # Prune expired volumes + Volume Retention = 30 days # How long should the Incremental Backups be kept? (#12) + Maximum Volume Bytes = 1G # Limit Volume size to something reasonable + Maximum Volumes = 100 # Limit number of Volumes in Pool + Label Format = "Incremental-" # Volumes will be labeled "Incremental-" +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/pool/Scratch.conf b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/pool/Scratch.conf new file mode 100644 index 00000000000..3a489b19871 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/pool/Scratch.conf @@ -0,0 +1,4 @@ +Pool { + Name = Scratch + Pool Type = Scratch +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/profile/operator.conf b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/profile/operator.conf new file mode 100644 index 00000000000..6edd0166dca --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/profile/operator.conf @@ -0,0 +1,18 @@ +Profile { + Name = operator + Description = "Profile allowing normal Bareos operations." + + Command ACL = !.bvfs_clear_cache, !.exit, !.sql + Command ACL = !configure, !create, !delete, !purge, !prune, !sqlquery, !umount, !unmount + Command ACL = *all* + + Catalog ACL = *all* + Client ACL = *all* + FileSet ACL = *all* + Job ACL = *all* + Plugin Options ACL = *all* + Pool ACL = *all* + Schedule ACL = *all* + Storage ACL = *all* + Where ACL = *all* +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/profile/webui-admin.conf b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/profile/webui-admin.conf new file mode 100644 index 00000000000..860af09e4fa --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/profile/webui-admin.conf @@ -0,0 +1,15 @@ +# +# bareos-webui webui-admin profile resource +# +Profile { + Name = "webui-admin" + CommandACL = !.bvfs_clear_cache, !.exit, !.sql, !configure, !create, !delete, !purge, !prune, !sqlquery, !umount, !unmount, *all* + Job ACL = *all* + Schedule ACL = *all* + Catalog ACL = *all* + Pool ACL = *all* + Storage ACL = *all* + Client ACL = *all* + FileSet ACL = *all* + Where ACL = *all* +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/profile/webui-readonly.conf b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/profile/webui-readonly.conf new file mode 100644 index 00000000000..fde80e8d4c0 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/profile/webui-readonly.conf @@ -0,0 +1,37 @@ +# +# bareos-webui profile resource: read-only access +# + +Profile { + Name = "webui-readonly" + + # Allow access to the following commands + CommandACL = .api, .help, use, version, status + CommandACL = list, llist + CommandACL = .clients, .jobs, .filesets, .pools, .storages, .defaults, .schedule + CommandACL = .bvfs_lsdirs, .bvfs_lsfiles, .bvfs_update, .bvfs_get_jobids, .bvfs_versions, .bvfs_restore + + # Allow access to the following job resources + Job ACL = *all* + + # Allow access to the following schedule resources + Schedule ACL = *all* + + # Allow access to the following catalog resources + Catalog ACL = *all* + + # Allow access to the following pool resources + Pool ACL = *all* + + # Allow access to the following storage resources + Storage ACL = *all* + + # Allow access to the following client resources + Client ACL = *all* + + # Allow access to the following filset resources + FileSet ACL = *all* + + # Allow access to restore to any filesystem location + Where ACL = *all* +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf new file mode 100644 index 00000000000..a2181c7db3d --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf @@ -0,0 +1,6 @@ +Schedule { + Name = "WeeklyCycle" +# Run = Full 1st sat at 21:00 # (#04) +# Run = Differential 2nd-5th sat at 21:00 # (#07) +# Run = Incremental mon-fri at 21:00 # (#10) +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf new file mode 100644 index 00000000000..49b245671cb --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf @@ -0,0 +1,5 @@ +Schedule { + Name = "WeeklyCycleAfterBackup" + Description = "This schedule does the catalog. It starts after the WeeklyCycle." +# Run = Full mon-fri at 21:10 +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/storage/File.conf.in b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/storage/File.conf.in new file mode 100644 index 00000000000..4058ddc7edc --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-dir.d/storage/File.conf.in @@ -0,0 +1,8 @@ +Storage { + Name = File + Address = @hostname@ # N.B. Use a fully qualified name here (do not use "localhost" here). + Password = "@sd_password@" + Device = FileStorage + Media Type = File + SD Port = @sd_port@ +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-fd.d/client/myself.conf.in b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-fd.d/client/myself.conf.in new file mode 100644 index 00000000000..e218bf06514 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-fd.d/client/myself.conf.in @@ -0,0 +1,20 @@ +Client { + Name = @basename@-fd + Maximum Concurrent Jobs = 20 + + # remove comment from "Plugin Directory" to load plugins from specified directory. + # if "Plugin Names" is defined, only the specified plugins will be loaded, + # otherwise all filedaemon plugins (*-fd.so) from the "Plugin Directory". + # + # Plugin Directory = "@python_plugin_module_src_fd@" + # Plugin Names = "" + + # if compatible is set to yes, we are compatible with bacula + # if set to no, new bareos features are enabled which is the default + # compatible = yes + + Working Directory = "@working_dir@" + Pid Directory = "@piddir@" + FD Port = @fd_port@ + +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in new file mode 100644 index 00000000000..c8dc7085a45 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in @@ -0,0 +1,5 @@ +Director { + Name = bareos-dir + Password = "@fd_password@" + Description = "Allow the configured Director to access this file daemon." +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in new file mode 100644 index 00000000000..630c3a9abd3 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-fd.d/director/bareos-mon.conf.in @@ -0,0 +1,6 @@ +Director { + Name = bareos-mon + Password = "@mon_fd_password@" + Monitor = yes + Description = "Restricted Director, used by tray-monitor to get the status of this file daemon." +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-fd.d/messages/Standard.conf b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-fd.d/messages/Standard.conf new file mode 100644 index 00000000000..97788e00573 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-fd.d/messages/Standard.conf @@ -0,0 +1,5 @@ +Messages { + Name = Standard + Director = bareos-dir = all, !skipped, !restored + Description = "Send relevant messages to the Director." +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-sd.d/device/FileStorage.conf.in b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-sd.d/device/FileStorage.conf.in new file mode 100644 index 00000000000..d7f2d1dcf19 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-sd.d/device/FileStorage.conf.in @@ -0,0 +1,11 @@ +Device { + Name = FileStorage + Media Type = File + Archive Device = @archivedir@ + LabelMedia = yes; # lets Bareos label unlabeled media + Random Access = yes; + AutomaticMount = yes; # when device opened, read it + RemovableMedia = no; + AlwaysOpen = no; + Description = "File device. A connecting Director must have the same Name and MediaType." +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in new file mode 100644 index 00000000000..deef3360c2d --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in @@ -0,0 +1,5 @@ +Director { + Name = bareos-dir + Password = "@sd_password@" + Description = "Director, who is permitted to contact this storage daemon." +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in new file mode 100644 index 00000000000..e3cfdee6315 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-sd.d/director/bareos-mon.conf.in @@ -0,0 +1,6 @@ +Director { + Name = bareos-mon + Password = "@mon_sd_password@" + Monitor = yes + Description = "Restricted Director, used by tray-monitor to get the status of this storage daemon." +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-sd.d/messages/Standard.conf b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-sd.d/messages/Standard.conf new file mode 100644 index 00000000000..468348e62fc --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-sd.d/messages/Standard.conf @@ -0,0 +1,5 @@ +Messages { + Name = Standard + Director = bareos-dir = all + Description = "Send all messages to the Director." +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in new file mode 100644 index 00000000000..3e1723fa60c --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in @@ -0,0 +1,14 @@ +Storage { + Name = bareos-sd + Maximum Concurrent Jobs = 20 + + # remove comment from "Plugin Directory" to load plugins from specified directory. + # if "Plugin Names" is defined, only the specified plugins will be loaded, + # otherwise all storage plugins (*-sd.so) from the "Plugin Directory". + # + # Plugin Directory = "@python_plugin_module_src_sd@" + # Plugin Names = "" + Working Directory = "@working_dir@" + Pid Directory = "@piddir@" + SD Port = @sd_port@ +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/bconsole.conf.in b/systemtests/tests/webui-readonly-run-job/etc/bareos/bconsole.conf.in new file mode 100644 index 00000000000..ecb6ad00dce --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/bconsole.conf.in @@ -0,0 +1,10 @@ +# +# Bareos User Agent (or Console) Configuration File +# + +Director { + Name = @basename@-dir + DIRport = @dir_port@ + address = @hostname@ + Password = "@dir_password@" +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in b/systemtests/tests/webui-readonly-run-job/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in new file mode 100644 index 00000000000..dd00dd9f103 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/tray-monitor.d/client/FileDaemon-local.conf.in @@ -0,0 +1,5 @@ +Client { + Name = @basename@-fd + Address = localhost + Password = "@mon_fd_password@" # password for FileDaemon +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/tray-monitor.d/director/Director-local.conf.in b/systemtests/tests/webui-readonly-run-job/etc/bareos/tray-monitor.d/director/Director-local.conf.in new file mode 100644 index 00000000000..55dae492250 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/tray-monitor.d/director/Director-local.conf.in @@ -0,0 +1,4 @@ +Director { + Name = bareos-dir + Address = localhost +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in b/systemtests/tests/webui-readonly-run-job/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in new file mode 100644 index 00000000000..cddfa253945 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/tray-monitor.d/monitor/bareos-mon.conf.in @@ -0,0 +1,7 @@ +Monitor { + # Name to establish connections to Director Console, Storage Daemon and File Daemon. + Name = bareos-mon + # Password to access the Director + Password = "@mon_dir_password@" # password for the Directors + RefreshInterval = 30 seconds +} diff --git a/systemtests/tests/webui-readonly-run-job/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in b/systemtests/tests/webui-readonly-run-job/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in new file mode 100644 index 00000000000..6538f4fd248 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/etc/bareos/tray-monitor.d/storage/StorageDaemon-local.conf.in @@ -0,0 +1,5 @@ +Storage { + Name = bareos-sd + Address = localhost + Password = "@mon_sd_password@" # password for StorageDaemon +} diff --git a/systemtests/tests/webui-readonly-run-job/testrunner.in b/systemtests/tests/webui-readonly-run-job/testrunner.in new file mode 100755 index 00000000000..521194aa753 --- /dev/null +++ b/systemtests/tests/webui-readonly-run-job/testrunner.in @@ -0,0 +1,62 @@ +#!/bin/sh +# +# Run a simple backup +# then restore it. +# +TestName="$(basename "$(pwd)")" +export TestName + +JobName=backup-bareos-fd +. ./environment +. ${scripts}/functions + +${scripts}/cleanup +${scripts}/setup + + +# Directory to backup. +# This directory will be created by setup_data(). +BackupDirectory="${tmp}/data" + +# Use a tgz to setup data to be backed up. +# Data will be placed at "${tmp}/data/". +setup_data + +start_test + +cat <$tmp/bconcmds +@$out /dev/null +messages +@$out $tmp/log1.out +run job=$JobName yes +wait +messages +quit +END_OF_DATA + +run_bareos + +@PHP@ -S 127.0.0.1:@php_port@ -t @PROJECT_SOURCE_DIR@/../webui/public/ >"$tmp/php.out" 2>&1 & + +PHP_PID=$(echo $!) + +# run tests but stop the test run on the first error or failure + +# +# test with readonly profile resource +# +export BAREOS_WEBUI_USERNAME=readonly +export BAREOS_WEBUI_PASSWORD=readonly +export BAREOS_WEBUI_PROFILE=readonly +export BAREOS_WEBUI_TESTNAME=test_run_default_job +echo "test with readonly profile:" >>"$tmp/selenium.out" 2>&1 +@PYTHON@ @CMAKE_SOURCE_DIR@/webui/tests/selenium/webui-selenium-test.py -v SeleniumTest.test_run_default_job >>"$tmp/selenium.out" 2>&1 + +estat=$? +export estat + +kill "${PHP_PID}" + +stop_bareos + +end_test diff --git a/webui/tests/selenium/webui-selenium-test.py b/webui/tests/selenium/webui-selenium-test.py index cbb17335629..2921aaf42c9 100755 --- a/webui/tests/selenium/webui-selenium-test.py +++ b/webui/tests/selenium/webui-selenium-test.py @@ -182,9 +182,14 @@ def setUp(self): if self.browser == 'chrome': self.chromedriverpath = self.getChromedriverpath() self.driver = webdriver.Chrome(self.chromedriverpath) - # disable experimental feature + # chrome webdriver option: disable experimental feature opt = webdriver.ChromeOptions() opt.add_experimental_option('w3c',False) + # chrome webdriver option: specify user data directory + opt.add_argument('--user-data-dir=/tmp/chrome-user-data-'+SeleniumTest.profile+'-'+SeleniumTest.testname) + # test in headless mode? + if self.chromeheadless: + opt.add_argument('--headless') self.driver = webdriver.Chrome(chrome_options=opt) # set explicit window size self.driver.set_window_size(1920,1080) @@ -209,7 +214,7 @@ def setUp(self): # # Tests # - def test_login(self): + def disabled_test_login(self): self.login() self.logout() @@ -263,7 +268,7 @@ def disabled_test_job_canceling(self): self.wait_and_click(By.LINK_TEXT, 'Back') self.logout() - def test_languages(self): + def disabled_test_languages(self): # Goes to login page, matches found languages against predefined list, throws exception if no match driver = self.driver driver.get(self.base_url + '/auth/login') @@ -277,7 +282,7 @@ def test_languages(self): if element not in found_elements: self.logger.info('The webui misses %s' % element) - def test_menue(self): + def disabled_test_menue(self): self.login() self.wait_and_click(By.ID, 'menu-topnavbar-director') self.wait_and_click(By.ID, 'menu-topnavbar-schedule') @@ -438,6 +443,7 @@ def wait_and_click(self, by, value, modal_by=None, modal_value=None): self.wait_for_spinner_absence() if modal_by and modal_value: try: + #self.driver.switchTo().activeElement(); # required??? self.driver.find_element(modal_by, modal_value).click() except: logger.info('skipped modal: %s %s not found', modal_by, modal_value) @@ -528,6 +534,11 @@ def get_env(): chromedriverpath = os.environ.get('BAREOS_WEBUI_CHROMEDRIVER_PATH') if chromedriverpath: SeleniumTest.chromedriverpath = chromedriverpath + chromeheadless = os.environ.get('BAREOS_WEBUI_CHROME_HEADLESS') + if chromeheadless: + SeleniumTest.chromeheadless = chromeheadless + else: + SeleniumTest.chromeheadless = True browser = os.environ.get('BAREOS_WEBUI_BROWSER') if browser: SeleniumTest.browser = browser @@ -543,6 +554,9 @@ def get_env(): profile = os.environ.get('BAREOS_WEBUI_PROFILE') if profile: SeleniumTest.profile = profile + testname = os.environ.get('BAREOS_WEBUI_TESTNAME') + if testname: + SeleniumTest.testname = testname client = os.environ.get('BAREOS_WEBUI_CLIENT_NAME') if client: SeleniumTest.client = client