Skip to content

Commit

Permalink
dird: systemtest: changing messages and updating systemtest
Browse files Browse the repository at this point in the history
  • Loading branch information
alaaeddineelamri committed Sep 22, 2021
1 parent 858aee4 commit dfac0ab
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
14 changes: 6 additions & 8 deletions core/src/dird/dbcheck_utils.cc
Expand Up @@ -182,11 +182,10 @@ std::vector<int> get_deletable_storageids(
for (int volumename = 0; volumename < volume_names.num_ids;
++volumename) {
Emsg3(M_WARNING, 0,
_("Orphaned storage '%s' with id '%lld' is being used by Media "
"with volumename '%s'. The orphaned Storage will only be "
"removed if you either delete or modify the related Media.\n"),
_("Orphaned storage '%s' is being used by volume '%s'. "
"An orphaned storage will only be removed when it is "
"no longer referenced.\n"),
orphaned_storage_names_list[orphaned_storage_id].c_str(),
orphaned_storage_ids_list.Id[orphaned_storage_id],
volume_names.name[volumename]);
}
}
Expand All @@ -202,11 +201,10 @@ std::vector<int> get_deletable_storageids(
for (int devicename = 0; devicename < device_names.num_ids;
++devicename) {
Emsg3(M_WARNING, 0,
_("Orphaned storage '%s' with id '%lld' is being used by "
"Device with name '%s'. The orphaned Storage will only be "
"removed if you either delete or modify the related Device.\n"),
_("Orphaned storage '%s' is being used by device '%s'. "
"An orphaned storage will only be removed when it is "
"no longer referenced.\n"),
orphaned_storage_names_list[orphaned_storage_id].c_str(),
orphaned_storage_ids_list.Id[orphaned_storage_id],
device_names.name[devicename]);
}
}
Expand Down
8 changes: 3 additions & 5 deletions core/src/dird/ua_cmds.cc
Expand Up @@ -2311,11 +2311,9 @@ static void DeleteStorage(UaContext* ua)
given_storagename)
== orphaned_storages.end()) {
ua->ErrorMsg(
_("The given storage name '%s' either does not exist at all, "
"or exists but the matching configuration file is not yet deleted. "
"If the storage configuration file is still available, it must be "
"first deleted from the bareos configurations in order to eliminate "
"it from the database.\n"),
_("The given storage '%s' either does not exist at all, or still "
"exists in the configuration. In order to remove a storage "
"from the catalog, its configuration must be removed first.\n"),
given_storagename.c_str());
return;
}
Expand Down
4 changes: 2 additions & 2 deletions systemtests/tests/multiplied-device/testrunner
Expand Up @@ -161,15 +161,15 @@ if test $? -ne 0 ; then
fi

# make sure storage 'File' cannot be deleted
grep "The given storage name 'File' either does not exist at all, or exists but the matching configuration file is not yet deleted" "${tmp}"/log4.out >/dev/null 2>&1
grep "The given storage 'File' either does not exist at all, or still exists in the configuration." "${tmp}"/log4.out >/dev/null 2>&1
if test $? -ne 0 ; then
echo "The delete command failed for an existing storage."
estat=1;
fi


# make sure extra storages fakestorage1 cannot be deleted
grep "Orphaned storage 'fakestorage1' with id '.' is being used by Media with volumename 'fakevolume'" "${tmp}"/log4.out >/dev/null 2>&1
grep "Orphaned storage 'fakestorage1' is being used by volume 'fakevolume'" "${tmp}"/log4.out >/dev/null 2>&1
if test $? -ne 0 ; then
echo "The delete command failed to detect fakestorages related to other medias."
estat=1;
Expand Down

0 comments on commit dfac0ab

Please sign in to comment.