]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
regress: Add test for very long directive
authorEric Bollengier <eric@baculasystems.com>
Tue, 9 Mar 2021 16:30:52 +0000 (17:30 +0100)
committerEric Bollengier <eric@baculasystems.com>
Fri, 26 Mar 2021 13:57:58 +0000 (14:57 +0100)
regress/tests/json-test

index 61b54a85ad86647a9c130d8936bba27637b69d9a..909860e68ff04972b5711623ba26b7ec23b332c2 100755 (executable)
@@ -25,6 +25,11 @@ Messages {
 }
 EOF
 
+VAR=START
+for i in $(seq 1 1000); do VAR=$VAR,www$i.superdomain.org ; done
+
+$bperl -e 'add_attribute("$conf/bacula-sd.conf", "TlsAllowedCn", "'$VAR',END", "Storage")'
+
 cat $tmp/1 >> $conf/bacula-dir.conf
 cat $tmp/1 >> $conf/bacula-sd.conf
 cat $tmp/1 >> $conf/bacula-fd.conf
@@ -36,4 +41,12 @@ if [ $? -ne 0 ]; then
     print_debug "ERROR: Issue while checking json output"
     estat=1
 fi
+
+min=`echo $VAR | wc -c`
+nb=`$bin/bsdjson  -r Storage -l Tls | wc -c`
+if [ $nb -lt $min ]; then
+    print_debug "ERROR: long directive was truncated"
+    estat=1
+fi
+
 end_test