Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
systemtests py3plug-fd-ldap: add another test case
Also test how the plugin behaves with wrong credentials.
- Loading branch information
1 parent
cbf53c4
commit a4fb780
Showing
3 changed files
with
55 additions
and
13 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
systemtests/tests/py3plug-fd-ldap/etc/bareos/bareos-dir.d/fileset/PluginFailingTest.conf.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FileSet { | ||
Name = "PluginFailingTest" | ||
Description = "Test the Plugin functionality with a Python Plugin." | ||
Include { | ||
Options { | ||
Signature = XXH128 | ||
} | ||
Plugin = "@python_module_name@:module_path=@python_plugin_module_src_test_dir@:module_name=bareos-fd-ldap:uri=ldap\\://@SYSTEMTEST_LDAP_ADDRESS_ESCAPED@:basedn=ou=backup,@SYSTEMTEST_LDAP_BASEDN@:bind_dn=@SYSTEMTEST_LDAP_BINDDN@:password=INVALID_PASSWORD" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
systemtests/tests/py3plug-fd-ldap/testrunner-wrong_credentials
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
set -e | ||
set -o pipefail | ||
set -u | ||
# | ||
# This systemtest tests the plugin functionality | ||
# of the Bareos FD with the Python LDAP plugin. | ||
# | ||
TestName="$(basename "$(pwd)")" | ||
export TestName | ||
|
||
JobName=backup-bareos-fd | ||
|
||
#shellcheck source=../environment.in | ||
. ./environment | ||
|
||
#shellcheck source=../scripts/functions | ||
. "${rscripts}"/functions | ||
|
||
start_test | ||
|
||
cat <<END_OF_DATA >$tmp/bconcmds | ||
@$out /dev/null | ||
messages | ||
@$out $tmp/wrong_credentials.out | ||
setdebug level=100 storage=File | ||
run job=$JobName fileset=PluginFailingTest yes | ||
wait | ||
messages | ||
END_OF_DATA | ||
|
||
run_bconsole "$@" | ||
|
||
check_for_zombie_jobs storage=File | ||
|
||
expect_grep "Failed to bind to LDAP uri due to invalid credentials" "$tmp/wrong_credentials.out" | ||
|
||
end_test |