]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
regress: update tests for plugin objects with Object Status
authorMichal Rakowski <michal.rakowski@baculasystems.com>
Wed, 31 Mar 2021 16:17:42 +0000 (18:17 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:03:01 +0000 (09:03 +0100)
regress/tests/copy-job-objects-test
regress/tests/plugin-objects-syntetic-test
regress/tests/plugin-objects-test

index 83766b931f39a8037aecfdb4485d420c36e9dc4e..cd51aaa3ceddd41710ed4f14847e1053d821bb33 100755 (executable)
@@ -118,7 +118,7 @@ fi
 
 if [ ${rest_objs_after} -ne $((rest_objs_before*2)) ]; then
    estat=1
-   print_debug "Wrong plugin objects count found in output: ${rest_objs_after}, expected $((rest_objs_before*2))"
+   print_debug "Wrong restore objects count found in output: ${rest_objs_after}, expected $((rest_objs_before*2))"
 fi
 
 stop_bacula
index 05cc83387d5486395cda51fef2b37cda30471656..815023b361822d61aec3bc94fb6053ac82dd686f 100755 (executable)
@@ -30,18 +30,18 @@ fi
 
 cat <<EOF >${cwd}/tmp/bconcmds
 sqlquery
-INSERT INTO Object (JobId, Path, Filename, PluginName, ObjectCategory, ObjectType, ObjectName, ObjectSource, ObjectUUID, ObjectSize)
-       VALUES (1, '/dummy/path2', 'file1', 'plugin1', 'Category_first', 'Type_first', 'objName1', 'objSource1', 'objUUID1', 1);
-INSERT INTO Object (JobId, Path, Filename, PluginName, ObjectCategory, ObjectType, ObjectName, ObjectSource, ObjectUUID, ObjectSize)
-       VALUES (2, '/dummy/path2', 'file2', 'plugin2', 'Category_second', 'Type_second', 'objName2', 'objSource2', 'objUUID2', 2);
-INSERT INTO Object (JobId, Path, Filename, PluginName, ObjectCategory, ObjectType, ObjectName, ObjectSource, ObjectUUID, ObjectSize)
-       VALUES (2, '/dummy/path2', 'file2', 'plugin2', 'Category_second','Type_second', 'objName2', 'objSource2', 'objUUID2', 2);
-INSERT INTO Object (JobId, Path, Filename, PluginName, ObjectCategory, ObjectType, ObjectName, ObjectSource, ObjectUUID, ObjectSize)
-       VALUES (3, '/dummy/path3', 'file3', 'plugin3', 'Category_third', 'Type_third', 'objName3', 'objSource3', 'objUUID3', 3);
-INSERT INTO Object (JobId, Path, Filename, PluginName, ObjectCategory, ObjectType, ObjectName, ObjectSource, ObjectUUID, ObjectSize)
-       VALUES (3, '/dummy/path3', 'file3', 'plugin3', 'Category_third', 'Type_third', 'objName3', 'objSource3', 'objUUID3', 3);
-INSERT INTO Object (JobId, Path, Filename, PluginName, ObjectCategory, ObjectType, ObjectName, ObjectSource, ObjectUUID, ObjectSize)
-       VALUES (3, '/dummy/path3', 'file3', 'plugin3', 'Category_third', 'Type_third', 'objName3', 'objSource3', 'objUUID3', 3);
+INSERT INTO Object (JobId, ObjectStatus, Path, Filename, PluginName, ObjectCategory, ObjectType, ObjectName, ObjectSource, ObjectUUID, ObjectSize, ObjectCount)
+       VALUES (1, 'T', '/dummy/path2', 'file1', 'plugin1', 'Category_first', 'Type_first', 'objName1', 'objSource1', 'objUUID1', 1, 123);
+INSERT INTO Object (JobId, ObjectStatus, Path, Filename, PluginName, ObjectCategory, ObjectType, ObjectName, ObjectSource, ObjectUUID, ObjectSize, ObjectCount)
+       VALUES (2, 'T', '/dummy/path2', 'file2', 'plugin2', 'Category_second', 'Type_second', 'objName2', 'objSource2', 'objUUID2', 2, 456);
+INSERT INTO Object (JobId, ObjectStatus, Path, Filename, PluginName, ObjectCategory, ObjectType, ObjectName, ObjectSource, ObjectUUID, ObjectSize, ObjectCount)
+       VALUES (2, 'T', '/dummy/path2', 'file2', 'plugin2', 'Category_second','Type_second', 'objName2', 'objSource2', 'objUUID2', 2, 456);
+INSERT INTO Object (JobId, ObjectStatus, Path, Filename, PluginName, ObjectCategory, ObjectType, ObjectName, ObjectSource, ObjectUUID, ObjectSize, ObjectCount)
+       VALUES (3, 'T', '/dummy/path3', 'file3', 'plugin3', 'Category_third', 'Type_third', 'objName3', 'objSource3', 'objUUID3', 3, 789);
+INSERT INTO Object (JobId, ObjectStatus, Path, Filename, PluginName, ObjectCategory, ObjectType, ObjectName, ObjectSource, ObjectUUID, ObjectSize, ObjectCount)
+       VALUES (3, 'T', '/dummy/path3', 'file3', 'plugin3', 'Category_third', 'Type_third', 'objName3', 'objSource3', 'objUUID3', 3, 789);
+INSERT INTO Object (JobId, ObjectStatus, Path, Filename, PluginName, ObjectCategory, ObjectType, ObjectName, ObjectSource, ObjectUUID, ObjectSize, ObjectCount)
+       VALUES (3, 'T', '/dummy/path3', 'file3', 'plugin3', 'Category_third', 'Type_third', 'objName3', 'objSource3', 'objUUID3', 3, 789);
 quit
 EOF
 
@@ -61,6 +61,24 @@ if [ ${objects_lines} -ne 6 ]; then
    print_debug "ERROR: Wrong plugin objects count found in output: ${objects_lines}, expected 6"
 fi
 
+objects_lines=`cat ${cwd}/tmp/log2.out | grep '123' | wc -l`
+if [ ${objects_lines} -ne 1 ]; then
+   estat=2
+   print_debug "ERROR: Wrong number of plugin objects with '123' count found in output: ${objects_lines}, expected 1"
+fi
+
+objects_lines=`cat ${cwd}/tmp/log2.out | grep '456' | wc -l`
+if [ ${objects_lines} -ne 2 ]; then
+   estat=2
+   print_debug "ERROR: Wrong number of plugin objects with '456' count found in output: ${objects_lines}, expected 2"
+fi
+
+objects_lines=`cat ${cwd}/tmp/log2.out | grep '789' | wc -l`
+if [ ${objects_lines} -ne 3 ]; then
+   estat=2
+   print_debug "ERROR: Wrong number of plugin objects with '789' count found in output: ${objects_lines}, expected 3"
+fi
+
 # Type filter
 cat <<EOF >${cwd}/tmp/bconcmds
 @$out ${cwd}/tmp/log3.out
index 22c73506197c63c166d6b0aa368fbc9ca89beebb..421014e6140248d4a0ff3d686fb496d19fa1f126 100755 (executable)
@@ -68,6 +68,19 @@ if [ "$id_postgres_obj" = "" ]; then
     estat=1
 fi
 
+n_OK=`cat ${cwd}/tmp/log3.out | grep "status: T" | wc -l`
+if [ $n_OK -ne 2 ]; then
+   estat=1
+   print_debug "Wrong count of \'T\' status for objects, expected 2, got: ${n_OK}"
+fi
+
+n_UNSET=`cat ${cwd}/tmp/log3.out | grep "status: U" | wc -l`
+if [ $n_UNSET -ne 4 ]; then
+   estat=1
+   print_debug "Wrong count of \'U\' status for objects, expected 4, got: ${n_UNSET}"
+fi
+
+
 # Get id of each type in restore menu
 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
 messages