From: Michal Rakowski Date: Wed, 31 Mar 2021 16:17:42 +0000 (+0200) Subject: regress: update tests for plugin objects with Object Status X-Git-Tag: Release-11.3.2~574 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=38f192e59887b466cdd717ba7f532c9baa1e4307;p=thirdparty%2Fbacula.git regress: update tests for plugin objects with Object Status --- diff --git a/regress/tests/copy-job-objects-test b/regress/tests/copy-job-objects-test index 83766b931..cd51aaa3c 100755 --- a/regress/tests/copy-job-objects-test +++ b/regress/tests/copy-job-objects-test @@ -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 diff --git a/regress/tests/plugin-objects-syntetic-test b/regress/tests/plugin-objects-syntetic-test index 05cc83387..815023b36 100755 --- a/regress/tests/plugin-objects-syntetic-test +++ b/regress/tests/plugin-objects-syntetic-test @@ -30,18 +30,18 @@ fi cat <${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 <${cwd}/tmp/bconcmds @$out ${cwd}/tmp/log3.out diff --git a/regress/tests/plugin-objects-test b/regress/tests/plugin-objects-test index 22c735061..421014e61 100755 --- a/regress/tests/plugin-objects-test +++ b/regress/tests/plugin-objects-test @@ -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 <${cwd}/tmp/bconcmds messages