diff --git a/CHANGELOG.md b/CHANGELOG.md index a2aad7c868e..f83c8f69154 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - openssl: unify ssl error logging [PR #2078] - Inherit RunScript elements between JobDef resources [PR #2097] - python-bareos: Add missing dh-python build dep [PR #2130] +- stored: list all devices if device is invalid/missing [PR #2122] [PR #2039]: https://github.com/bareos/bareos/pull/2039 [PR #2040]: https://github.com/bareos/bareos/pull/2040 @@ -49,6 +50,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [PR #2109]: https://github.com/bareos/bareos/pull/2109 [PR #2111]: https://github.com/bareos/bareos/pull/2111 [PR #2116]: https://github.com/bareos/bareos/pull/2116 +[PR #2122]: https://github.com/bareos/bareos/pull/2122 [PR #2130]: https://github.com/bareos/bareos/pull/2130 [PR #2132]: https://github.com/bareos/bareos/pull/2132 [PR #2153]: https://github.com/bareos/bareos/pull/2153 diff --git a/core/src/stored/bcopy.cc b/core/src/stored/bcopy.cc index 8c18af1d625..bb04376d38f 100644 --- a/core/src/stored/bcopy.cc +++ b/core/src/stored/bcopy.cc @@ -3,7 +3,7 @@ Copyright (C) 2002-2012 Free Software Foundation Europe e.V. Copyright (C) 2011-2012 Planets Communications B.V. - Copyright (C) 2013-2024 Bareos GmbH & Co. KG + Copyright (C) 2013-2025 Bareos GmbH & Co. KG This program is Free Software; you can redistribute it and/or modify it under the terms of version three of the GNU Affero General Public @@ -149,7 +149,6 @@ int main(int argc, char* argv[]) "(either as name of a Bareos Storage Daemon Device resource " "or identical to the " "Archive Device in a Bareos Storage Daemon Device resource).") - ->required() ->type_name(" "); std::string output_archive; @@ -159,7 +158,6 @@ int main(int argc, char* argv[]) "(either as name of a Bareos Storage Daemon Device resource " "or identical to the " "Archive Device in a Bareos Storage Daemon Device resource).") - ->required() ->type_name(" "); ParseBareosApp(bcopy_app, argc, argv); @@ -173,6 +171,17 @@ int main(int argc, char* argv[]) my_config = InitSdConfig(configFile.c_str(), M_CONFIG_ERROR); ParseSdConfig(configFile.c_str(), M_CONFIG_ERROR); + if (input_archive.empty()) { + printf(T_("Missing input device. %sNothing done.\n"), + AvailableDevicesListing().c_str()); + return BEXIT_CLI_PARSING_ERROR; + } else if (output_archive.empty()) { + printf(T_("Missing output device. %sNothing done.\n"), + AvailableDevicesListing().c_str()); + return BEXIT_CLI_PARSING_ERROR; + } + + DirectorResource* director = nullptr; if (!DirectorName.empty()) { foreach_res (director, R_DIRECTOR) { diff --git a/core/src/stored/bextract.cc b/core/src/stored/bextract.cc index faf297fac50..57ade37abf3 100644 --- a/core/src/stored/bextract.cc +++ b/core/src/stored/bextract.cc @@ -3,7 +3,7 @@ Copyright (C) 2000-2011 Free Software Foundation Europe e.V. Copyright (C) 2011-2012 Planets Communications B.V. - Copyright (C) 2013-2024 Bareos GmbH & Co. KG + Copyright (C) 2013-2025 Bareos GmbH & Co. KG This program is Free Software; you can redistribute it and/or modify it under the terms of version three of the GNU Affero General Public @@ -212,22 +212,25 @@ int main(int argc, char* argv[]) "Specify the input device name (either as name of a Bareos " "Storage Daemon Device resource or identical to the Archive " "Device in a Bareos Storage Daemon Device resource).") - ->required() ->type_name(" "); std::string directory_to_store_files; bextract_app .add_option("target-directory", directory_to_store_files, "Specify directory where to store files.") - ->required() ->type_name(" "); - ParseBareosApp(bextract_app, argc, argv); my_config = InitSdConfig(configfile, M_CONFIG_ERROR); ParseSdConfig(configfile, M_CONFIG_ERROR); + if (archive_device_name.empty()) { + printf(T_("Missing device. %sNothing done.\n"), + AvailableDevicesListing().c_str()); + return BEXIT_CLI_PARSING_ERROR; + } + static DirectorResource* director = nullptr; if (!DirectorName.empty()) { foreach_res (director, R_DIRECTOR) { diff --git a/core/src/stored/bls.cc b/core/src/stored/bls.cc index aae46f5a77f..8fdfd79c2f5 100644 --- a/core/src/stored/bls.cc +++ b/core/src/stored/bls.cc @@ -3,7 +3,7 @@ Copyright (C) 2000-2012 Free Software Foundation Europe e.V. Copyright (C) 2011-2012 Planets Communications B.V. - Copyright (C) 2013-2024 Bareos GmbH & Co. KG + Copyright (C) 2013-2025 Bareos GmbH & Co. KG This program is Free Software; you can redistribute it and/or modify it under the terms of version three of the GNU Affero General Public @@ -210,7 +210,6 @@ int main(int argc, char* argv[]) "(either as name of a Bareos Storage Daemon Device resource " "or identical to the " "Archive Device in a Bareos Storage Daemon Device resource).") - ->required() ->type_name(" "); ParseBareosApp(bls_app, argc, argv); @@ -218,6 +217,12 @@ int main(int argc, char* argv[]) my_config = InitSdConfig(configfile, M_CONFIG_ERROR); ParseSdConfig(configfile, M_CONFIG_ERROR); + if (device_names.size() == 0) { + printf(T_("Missing input device. %sNothing done.\n"), + AvailableDevicesListing().c_str()); + return BEXIT_CLI_PARSING_ERROR; + } + if (!DirectorName.empty()) { foreach_res (director, R_DIRECTOR) { if (bstrcmp(director->resource_name_, DirectorName.c_str())) { break; } diff --git a/core/src/stored/bscan.cc b/core/src/stored/bscan.cc index dbee848ab79..9350a50a296 100644 --- a/core/src/stored/bscan.cc +++ b/core/src/stored/bscan.cc @@ -3,7 +3,7 @@ Copyright (C) 2001-2011 Free Software Foundation Europe e.V. Copyright (C) 2011-2016 Planets Communications B.V. - Copyright (C) 2013-2024 Bareos GmbH & Co. KG + Copyright (C) 2013-2025 Bareos GmbH & Co. KG This program is Free Software; you can redistribute it and/or modify it under the terms of version three of the GNU Affero General Public @@ -236,7 +236,6 @@ int main(int argc, char* argv[]) "Specify the input device name (either as name of a Bareos " "Storage Daemon Device resource or identical to the Archive " "Device in a Bareos Storage Daemon Device resource).") - ->required() ->type_name(" "); ParseBareosApp(bscan_app, argc, argv); @@ -244,6 +243,12 @@ int main(int argc, char* argv[]) my_config = InitSdConfig(configfile, M_CONFIG_ERROR); ParseSdConfig(configfile, M_CONFIG_ERROR); + if (device_name.empty()) { + printf(T_("Missing input device. %sNothing done.\n"), + AvailableDevicesListing().c_str()); + return BEXIT_CLI_PARSING_ERROR; + } + DirectorResource* director = nullptr; if (!DirectorName.empty()) { foreach_res (director, R_DIRECTOR) { diff --git a/core/src/stored/btape.cc b/core/src/stored/btape.cc index fa3652a4f31..ca96a502377 100644 --- a/core/src/stored/btape.cc +++ b/core/src/stored/btape.cc @@ -3,7 +3,7 @@ Copyright (C) 2000-2012 Free Software Foundation Europe e.V. Copyright (C) 2011-2012 Planets Communications B.V. - Copyright (C) 2013-2024 Bareos GmbH & Co. KG + Copyright (C) 2013-2025 Bareos GmbH & Co. KG This program is Free Software; you can redistribute it and/or modify it under the terms of version three of the GNU Affero General Public @@ -289,7 +289,6 @@ int main(int margc, char* margv[]) "Specify the input device name (either as name of a Bareos " "Storage Daemon Device resource or identical to the Archive " "Device in a Bareos Storage Daemon Device resource).") - ->required() ->type_name(" "); btape_app.add_option_group("Interactive commands", @@ -309,6 +308,12 @@ int main(int margc, char* margv[]) my_config = InitSdConfig(configfile, M_CONFIG_ERROR); ParseSdConfig(configfile, M_CONFIG_ERROR); + if (archive_name.empty()) { + printf(T_("Missing input device. %sNothing done.\n"), + AvailableDevicesListing().c_str()); + return BEXIT_CLI_PARSING_ERROR; + } + DirectorResource* director = nullptr; if (!DirectorName.empty()) { foreach_res (director, R_DIRECTOR) { diff --git a/core/src/stored/butil.cc b/core/src/stored/butil.cc index 6b7f40d822c..c68efc9877b 100644 --- a/core/src/stored/butil.cc +++ b/core/src/stored/butil.cc @@ -3,7 +3,7 @@ Copyright (C) 2000-2010 Free Software Foundation Europe e.V. Copyright (C) 2011-2012 Planets Communications B.V. - Copyright (C) 2013-2024 Bareos GmbH & Co. KG + Copyright (C) 2013-2025 Bareos GmbH & Co. KG This program is Free Software; you can redistribute it and/or modify it under the terms of version three of the GNU Affero General Public @@ -44,6 +44,8 @@ #include "lib/parse_conf.h" #include "include/jcr.h" +#include + namespace storagedaemon { /* Forward referenced functions */ @@ -123,6 +125,25 @@ JobControlRecord* SetupJcr(const char* name, return jcr; } +std::string AvailableDevicesListing() +{ + std::vector devices; + for (BareosResource* resource = nullptr; + (resource = my_config->GetNextRes(R_DEVICE, resource));) { + DeviceResource* device = dynamic_cast(resource); + std::string device_str; + device_str += " \""; + device_str += device->resource_name_; + device_str += "\" ("; + device_str += device->archive_device_string; + device_str += ")\n"; + devices.emplace_back(std::move(device_str)); + } + std::sort(devices.begin(), devices.end()); + std::string devices_str = "Available Devices:\n"; + for (const std::string& device : devices) { devices_str += device; } + return devices_str; +} /** * Setup device, jcr, and prepare to access device. * If the caller wants read access, acquire the device, otherwise, @@ -170,8 +191,9 @@ static bool setup_to_access_device(DeviceControlRecord* dcr, } if ((device_resource = find_device_res(dev_name, readonly)) == NULL) { - Jmsg2(jcr, M_FATAL, 0, T_("Cannot find device \"%s\" in config file %s.\n"), - dev_name, configfile); + Jmsg2(jcr, M_FATAL, 0, + T_("Cannot find device \"%s\" in config file %s.\n%s"), dev_name, + configfile, AvailableDevicesListing().c_str()); return false; } diff --git a/core/src/stored/butil.h b/core/src/stored/butil.h index 0de708d8b53..6242cae54df 100644 --- a/core/src/stored/butil.h +++ b/core/src/stored/butil.h @@ -2,7 +2,7 @@ /* BAREOS® - Backup Archiving REcovery Open Sourced - Copyright (C) 2018-2022 Bareos GmbH & Co. KG + Copyright (C) 2018-2025 Bareos GmbH & Co. KG This program is Free Software; you can redistribute it and/or modify it under the terms of version three of the GNU Affero General Public @@ -44,6 +44,7 @@ JobControlRecord* SetupJcr(const char* name, const std::string& VolumeName, bool readonly); void DisplayTapeErrorStatus(JobControlRecord* jcr, Device* dev); +std::string AvailableDevicesListing(); } /* namespace storagedaemon */ diff --git a/docs/manuals/source/include/autogenerated/usage/bcopy.txt b/docs/manuals/source/include/autogenerated/usage/bcopy.txt index 9cbb4c5d8c5..ddae88e59c9 100644 --- a/docs/manuals/source/include/autogenerated/usage/bcopy.txt +++ b/docs/manuals/source/include/autogenerated/usage/bcopy.txt @@ -1,14 +1,12 @@ -Usage: bcopy [OPTIONS] input-archive output-archive +Usage: bcopy [OPTIONS] [input-archive] [output-archive] Positionals: input-archive - REQUIRED Specify the input device name (either as name of a Bareos Storage Daemon Device resource or identical to the Archive Device in a Bareos Storage Daemon Device resource). output-archive - REQUIRED Specify the output device name (either as name of a Bareos Storage Daemon Device resource or identical to the Archive Device in a Bareos Storage Daemon Device resource). diff --git a/docs/manuals/source/include/autogenerated/usage/bextract.txt b/docs/manuals/source/include/autogenerated/usage/bextract.txt index 6a58a3cb9d8..0486a188ebd 100644 --- a/docs/manuals/source/include/autogenerated/usage/bextract.txt +++ b/docs/manuals/source/include/autogenerated/usage/bextract.txt @@ -1,14 +1,12 @@ -Usage: bextract [OPTIONS] bareos-archive-device-name target-directory +Usage: bextract [OPTIONS] [bareos-archive-device-name] [target-directory] Positionals: bareos-archive-device-name - REQUIRED Specify the input device name (either as name of a Bareos Storage Daemon Device resource or identical to the Archive Device in a Bareos Storage Daemon Device resource). target-directory - REQUIRED Specify directory where to store files. diff --git a/docs/manuals/source/include/autogenerated/usage/bls.txt b/docs/manuals/source/include/autogenerated/usage/bls.txt index ce60f2de14c..7a14148d587 100644 --- a/docs/manuals/source/include/autogenerated/usage/bls.txt +++ b/docs/manuals/source/include/autogenerated/usage/bls.txt @@ -1,8 +1,7 @@ -Usage: bls [OPTIONS] device-names... +Usage: bls [OPTIONS] [device-names...] Positionals: device-names ... - REQUIRED Specify the input device name (either as name of a Bareos Storage Daemon Device resource or identical to the Archive Device in a Bareos Storage Daemon Device resource). diff --git a/docs/manuals/source/include/autogenerated/usage/bscan.txt b/docs/manuals/source/include/autogenerated/usage/bscan.txt index 11334ec9ffb..74d00f4922f 100644 --- a/docs/manuals/source/include/autogenerated/usage/bscan.txt +++ b/docs/manuals/source/include/autogenerated/usage/bscan.txt @@ -1,8 +1,7 @@ -Usage: bscan [OPTIONS] device_name +Usage: bscan [OPTIONS] [device_name] Positionals: device_name - REQUIRED Specify the input device name (either as name of a Bareos Storage Daemon Device resource or identical to the Archive Device in a Bareos Storage Daemon Device resource). diff --git a/docs/manuals/source/include/autogenerated/usage/btape.txt b/docs/manuals/source/include/autogenerated/usage/btape.txt index e02fa678882..72404219c69 100644 --- a/docs/manuals/source/include/autogenerated/usage/btape.txt +++ b/docs/manuals/source/include/autogenerated/usage/btape.txt @@ -1,8 +1,7 @@ -Usage: btape [OPTIONS] bareos-archive-device-name +Usage: btape [OPTIONS] [bareos-archive-device-name] Positionals: bareos-archive-device-name - REQUIRED Specify the input device name (either as name of a Bareos Storage Daemon Device resource or identical to the Archive Device in a Bareos Storage Daemon Device resource). diff --git a/systemtests/CMakeLists.txt b/systemtests/CMakeLists.txt index 80e0ed39563..bb494d46b6b 100644 --- a/systemtests/CMakeLists.txt +++ b/systemtests/CMakeLists.txt @@ -1,6 +1,6 @@ # BAREOS® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2019-2024 Bareos GmbH & Co. KG +# Copyright (C) 2019-2025 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public @@ -33,7 +33,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") system:bareos-basic:bls-autoxflate system:bareos-basic:bscan-autoxflate system:bareos-basic:volume-recycling - system:bscan-bextract-bls-bcopy + system:bscan-bextract-bls-bcopy-btape system:checkpoints:checkpoints-regular-backup system:client-initiated system:commandline-options diff --git a/systemtests/environment.in b/systemtests/environment.in index a983e2492aa..a67c36bad56 100644 --- a/systemtests/environment.in +++ b/systemtests/environment.in @@ -84,6 +84,7 @@ export BAREOS_BSCAN_BINARY=$(dirname "@BSCAN_BINARY@")/$CMAKE_CONFIG_TYPE/$(base export BAREOS_BLS_BINARY=$(dirname "@BLS_BINARY@")/$CMAKE_CONFIG_TYPE/$(basename "@BLS_BINARY@") export BAREOS_BCONSOLE_BINARY=$(dirname "@BCONSOLE_UNSAFE_BINARY@")/$CMAKE_CONFIG_TYPE/$(basename "@BCONSOLE_UNSAFE_BINARY@") export BAREOS_BEXTRACT_BINARY=$(dirname "@BEXTRACT_BINARY@")/$CMAKE_CONFIG_TYPE/$(basename "@BEXTRACT_BINARY@") +export BAREOS_BTAPE_BINARY=$(dirname "@BTAPE_BINARY@")/$CMAKE_CONFIG_TYPE/$(basename "@BTAPE_BINARY@") export BAREOS_DBCHECK_BINARY=$(dirname "@BAREOS_DBCHECK_BINARY@")/$CMAKE_CONFIG_TYPE/$(basename "@BAREOS_DBCHECK_BINARY@") export BAREOS_BCOPY_BINARY=$(dirname "@BCOPY_BINARY@")/$CMAKE_CONFIG_TYPE/$(basename "@BCOPY_BINARY@") export BAREOS_BDEDUPESTIMATE_BINARY=$(dirname "@BDEDUPESTIMATE_BINARY@")/$CMAKE_CONFIG_TYPE/$(basename "@BDEDUPESTIMATE_BINARY@") diff --git a/systemtests/tests/CMakeLists.txt b/systemtests/tests/CMakeLists.txt index 44e15b06175..026e59555b9 100644 --- a/systemtests/tests/CMakeLists.txt +++ b/systemtests/tests/CMakeLists.txt @@ -1,6 +1,6 @@ # BAREOS® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2021-2024 Bareos GmbH & Co. KG +# Copyright (C) 2021-2025 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public @@ -30,7 +30,7 @@ add_subdirectory(bareos-acl) add_subdirectory(bconsole-basic) add_subdirectory(bconsole-pam) add_subdirectory(block-size) -add_subdirectory(bscan-bextract-bls-bcopy) +add_subdirectory(bscan-bextract-bls-bcopy-btape) add_subdirectory(catalog) add_subdirectory(checkpoints) add_subdirectory(chflags) diff --git a/systemtests/tests/bscan-bextract-bls-bcopy/CMakeLists.txt b/systemtests/tests/bscan-bextract-bls-bcopy-btape/CMakeLists.txt similarity index 94% rename from systemtests/tests/bscan-bextract-bls-bcopy/CMakeLists.txt rename to systemtests/tests/bscan-bextract-bls-bcopy-btape/CMakeLists.txt index 2a79b7f8aea..8db4064c458 100644 --- a/systemtests/tests/bscan-bextract-bls-bcopy/CMakeLists.txt +++ b/systemtests/tests/bscan-bextract-bls-bcopy-btape/CMakeLists.txt @@ -1,6 +1,6 @@ # BAREOS® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2021-2022 Bareos GmbH & Co. KG +# Copyright (C) 2021-2025 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public diff --git a/systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in b/systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in similarity index 100% rename from systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in rename to systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/catalog/MyCatalog.conf.in diff --git a/systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in b/systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in similarity index 100% rename from systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in rename to systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/client/bareos-fd.conf.in diff --git a/systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in b/systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in similarity index 100% rename from systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in rename to systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/director/bareos-dir.conf.in diff --git a/systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in b/systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in similarity index 100% rename from systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in rename to systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/fileset/Catalog.conf.in diff --git a/systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/fileset/SelfTest.conf.in b/systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/fileset/SelfTest.conf.in similarity index 100% rename from systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/fileset/SelfTest.conf.in rename to systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/fileset/SelfTest.conf.in diff --git a/systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in b/systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in similarity index 100% rename from systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in rename to systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/job/RestoreFiles.conf.in diff --git a/systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in b/systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in similarity index 100% rename from systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in rename to systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/job/backup-bareos-fd.conf.in diff --git a/systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in b/systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in similarity index 100% rename from systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in rename to systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/jobdefs/DefaultJob.conf.in diff --git a/systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/messages/Daemon.conf.in b/systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/messages/Daemon.conf.in similarity index 100% rename from systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/messages/Daemon.conf.in rename to systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/messages/Daemon.conf.in diff --git a/systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/messages/Standard.conf.in b/systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/messages/Standard.conf.in similarity index 100% rename from systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/messages/Standard.conf.in rename to systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/messages/Standard.conf.in diff --git a/systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/pool/Differential.conf b/systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/pool/Differential.conf similarity index 100% rename from systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/pool/Differential.conf rename to systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/pool/Differential.conf diff --git a/systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/pool/Full.conf b/systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/pool/Full.conf similarity index 100% rename from systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/pool/Full.conf rename to systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/pool/Full.conf diff --git a/systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/pool/Incremental.conf b/systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/pool/Incremental.conf similarity index 100% rename from systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/pool/Incremental.conf rename to systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/pool/Incremental.conf diff --git a/systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/pool/Scratch.conf b/systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/pool/Scratch.conf similarity index 100% rename from systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/pool/Scratch.conf rename to systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/pool/Scratch.conf diff --git a/systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/profile/operator.conf b/systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/profile/operator.conf similarity index 100% rename from systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/profile/operator.conf rename to systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/profile/operator.conf diff --git a/systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/storage/File.conf.in b/systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/storage/File.conf.in similarity index 100% rename from systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-dir.d/storage/File.conf.in rename to systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-dir.d/storage/File.conf.in diff --git a/systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-fd.d/client/myself.conf.in b/systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-fd.d/client/myself.conf.in similarity index 100% rename from systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-fd.d/client/myself.conf.in rename to systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-fd.d/client/myself.conf.in diff --git a/systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in b/systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in similarity index 100% rename from systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in rename to systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-fd.d/director/bareos-dir.conf.in diff --git a/systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-fd.d/messages/Standard.conf b/systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-fd.d/messages/Standard.conf similarity index 100% rename from systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-fd.d/messages/Standard.conf rename to systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-fd.d/messages/Standard.conf diff --git a/systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-sd.d/device/FileStorage.conf b/systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-sd.d/device/FileStorage.conf similarity index 100% rename from systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-sd.d/device/FileStorage.conf rename to systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-sd.d/device/FileStorage.conf diff --git a/systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-sd.d/device/FileStorage2.conf b/systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-sd.d/device/FileStorage2.conf similarity index 100% rename from systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-sd.d/device/FileStorage2.conf rename to systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-sd.d/device/FileStorage2.conf diff --git a/systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in b/systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in similarity index 100% rename from systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in rename to systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-sd.d/director/bareos-dir.conf.in diff --git a/systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-sd.d/messages/Standard.conf b/systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-sd.d/messages/Standard.conf similarity index 100% rename from systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-sd.d/messages/Standard.conf rename to systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-sd.d/messages/Standard.conf diff --git a/systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in b/systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in similarity index 100% rename from systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in rename to systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bareos-sd.d/storage/bareos-sd.conf.in diff --git a/systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bconsole.conf.in b/systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bconsole.conf.in similarity index 100% rename from systemtests/tests/bscan-bextract-bls-bcopy/etc/bareos/bconsole.conf.in rename to systemtests/tests/bscan-bextract-bls-bcopy-btape/etc/bareos/bconsole.conf.in diff --git a/systemtests/tests/bscan-bextract-bls-bcopy/testrunner b/systemtests/tests/bscan-bextract-bls-bcopy-btape/testrunner similarity index 77% rename from systemtests/tests/bscan-bextract-bls-bcopy/testrunner rename to systemtests/tests/bscan-bextract-bls-bcopy-btape/testrunner index 147e5b9f198..dac4ed841de 100755 --- a/systemtests/tests/bscan-bextract-bls-bcopy/testrunner +++ b/systemtests/tests/bscan-bextract-bls-bcopy-btape/testrunner @@ -47,6 +47,33 @@ END_OF_DATA run_bconsole "$tmp/bconcmds" +expect_device_listing() +{ + log_no_device="${tmp}/no-device-$1.out" + "$2" -c "${conf}" &> "$log_no_device" || : + if ! grep -q "\"FileStorage\"" "$log_no_device" || ! grep -q "\"FileStorage2\"" "$log_no_device"; then + echo "Expected listing of available devices if no device is specified but not found in output, instead got:" + cat $log_no_device + stop_bareos + exit 1 + fi + + log_invalid_device="${tmp}/invalid-device-$1.out" + "$2" -c "${conf}" InvalidDevice "${@:3}" &> "$log_invalid_device" || : + if ! grep -q "\"FileStorage\"" "$log_invalid_device" || ! grep -q "\"FileStorage2\"" "$log_invalid_device"; then + echo "Expected listing of available devices if invalid device is specified but not found in output, instead got:" + cat $log_invalid_device + stop_bareos + exit 1 + fi +} + +expect_device_listing bscan $BAREOS_BSCAN_BINARY +expect_device_listing bextract $BAREOS_BEXTRACT_BINARY . +expect_device_listing bls $BAREOS_BLS_BINARY +expect_device_listing bcopy $BAREOS_BCOPY_BINARY OtherInvalidDevice +expect_device_listing btape $BAREOS_BTAPE_BINARY + run_bls -vv -V TestVolume001 FileStorage ret=$? if [ $ret -ne 0 ]; then