metadatas.reset();
metadatas_list.destroy();
- while (backend.ctx->read_command(ctx, cmd) > 0){
+ while (backend.ctx->read_command(ctx, cmd) > 0)
+ {
DMSG(ctx, DINFO, "read_command(2): %s\n", cmd.c_str());
// int nrscan = sscanf(cmd.c_str(), "STAT:%c %ld %d %d %o %d", &type, &size, &uid, &gid, &perms, &nlinks);
nfi = -1;
JMSG(ctx, M_INFO, "%s", errmsg.c_str());
continue;
+ case 'S':
+ // handle saved message
+ DMSG(ctx, DDEBUG, "%s", errmsg.c_str());
+ JMSG(ctx, M_SAVED, "%s", errmsg.c_str());
+ continue;
+
+ case 'N':
+ // handle not-saved message
+ DMSG(ctx, DDEBUG, "%s", errmsg.c_str());
+ JMSG(ctx, M_NOTSAVED, "%s", errmsg.c_str());
+ continue;
+
+ case 'R':
+ // handle restored message
+ DMSG(ctx, DINFO, "%s", errmsg.c_str());
+ JMSG(ctx, M_RESTORED, "%s", errmsg.c_str());
+ continue;
+
+ case 'P':
+ // handle skipped message
+ DMSG(ctx, DINFO, "%s", errmsg.c_str());
+ JMSG(ctx, M_SKIPPED, "%s", errmsg.c_str());
+ continue;
+
+ case 'O':
+ // handle operator message (now it is only M_MOUNT)
+ DMSG(ctx, DINFO, "%s", errmsg.c_str());
+ JMSG(ctx, M_MOUNT, "%s", errmsg.c_str());
+ continue;
+
+ case 'V':
+ // handle event message
+ DMSG(ctx, DINFO, "%s", errmsg.c_str());
+ JMSG(ctx, M_EVENTS, "%s", errmsg.c_str());
+ continue;
+
+ case 'Q':
+ // handle event message
+ DMSG(ctx, DERROR, "%s", errmsg.c_str());
+ JMSG(ctx, M_ERROR, "%s", errmsg.c_str());
+ continue;
+
default:
DMSG1(ctx, DERROR, "Protocol error. Unknown packet: %c\n", header.status);
JMSG1(ctx, M_FATAL, "Protocol error. Unknown packet: %c\n", header.status);
write_plugin('I', "TEST8-Error-Start");
/* here comes a file data contents */
write_plugin('E', "TEST8-Error: Standard IO Error goes Here");
- // write_plugin('C', "DATA\n");
- // write_plugin('D', "/* here comes a file data contents */");
- // write_plugin('D', "/* here comes another file line */");
- // write_plugin('D', "/* here comes another file line */");
- // write_plugin('D', "/* here comes another file line */");
write_plugin('I', "TEST8-Error-End");
// signal_eod();
}
write_plugin('I', "TEST PluginObject Last - END");
}
+ write_plugin('I', "M_INFO test message\n");
+ write_plugin('W', "M_WARNING test message\n");
+ write_plugin('S', "M_SAVED test message\n");
+ write_plugin('N', "M_NOTSAVED test message\n");
+ write_plugin('R', "M_RESTORED test message\n");
+ write_plugin('P', "M_SKIPPED test message\n");
+ write_plugin('O', "M_OPER?MOUNT test message\n");
+ write_plugin('V', "M_EVENTS test message\n");
+ if (regress_standard_error_backup)
+ {
+ write_plugin('Q', "M_ERROR test message\n");
+ }
+
/* this is the end of all data */
signal_eod();
}
write_plugin('C', "STAT:E 0 300 300 0100640 1\n");
write_plugin('C', "TSTAMP:1504271937 1504271937 1504271937\n");
signal_eod();
- // write_plugin('I', "TEST5B");
snprintf(buf, BIGBUFLEN, "FNAME:%s/bucket/%d/vmsnap.iso\n", PLUGINPREFIX, mypid);
write_plugin('C', buf);
snprintf(buf, BIGBUFLEN, "LSTAT:/bucket/%d/vm1.iso\n", mypid);
write_plugin('C', buf);
signal_eod();
- // write_plugin('I', "TEST5B");
snprintf(buf, BIGBUFLEN, "FNAME:%s/bucket/%d/\n", PLUGINPREFIX, mypid);
write_plugin('C', buf);
write_plugin('C', "STAT:D 1024 100 100 040755 1\n");
write_plugin('C', "TSTAMP:1504271937 1504271937 1504271937\n");
signal_eod();
- // write_plugin('I', "TEST5 - dir");
snprintf(buf, BIGBUFLEN, "FNAME:%s/bucket/\n", PLUGINPREFIX);
write_plugin('C', buf);
write_plugin('C', "STAT:D 1024 100 100 040755 1\n");
write_plugin('C', "TSTAMP:1504271937 1504271937 1504271937\n");
signal_eod();
- // write_plugin('I', "TEST5 - another dir");
/* this is the end of all data */
signal_eod();
operatorcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula regression\) %r\" -s \"Regression: Intervention needed for %j\" %r"
# MailOnError = @job_email@ = all, !terminate
# operator = @job_email@ = mount
- console = all, !skipped, !terminate
+ console = all
append = "@working_dir@/log" = all, !skipped
catalog = all, !skipped
# . scripts/metaplugin-protocol-tests.sh
#
-if [ "x$JobBackup1" = "x" ] || [ "x$JobBackup2" = "x" ] || [ "x$JobBackup3" = "x" ] || [ "x$JobBackup4" = "x" ] || [ "x$FilesetBackup1" = "x" ]
+if [ "x$JobBackup1" = "x" ] || [ "x$JobBackup2" = "x" ] || [ "x$JobBackup3" = "x" ] || [ "x$JobBackup4" = "x" ] || [ "x$JobBackup5" = "x" ] || [ "x$JobBackup6" = "x" ] || [ "x$FilesetBackup1" = "x" ]
then
echo "You have to setup required variables!"
exit 2
run_bconsole
+# now backup standard error information
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@#
+@# Backup with error
+@#
+@output /dev/null
+messages
+@$out ${cwd}/tmp/log8.out
+status client=$CLIENT
+setdebug level=500 client=$CLIENT trace=1
+run job=$JobBackup6 yes
+wait
+status client=$CLIENT
+messages
+llist job=$JobBackup6
+@output
+quit
+END_OF_DATA
+
+run_bconsole
+
# now test estimate job
cat <<END_OF_DATA >${cwd}/tmp/bconcmds
bstat=$((bstat+32))
fi
+RET=$(grep "jobstatus:" ${cwd}/tmp/log8.out | awk '{print $2}')
+META=$(grep -c "TEST14 - backup metadata" ${cwd}/tmp/log7.out)
+BEND=$(grep -w -c "TESTEND" ${cwd}/tmp/log7.out)
+if [ "x$RET" != "xT" ] || [ "$META" -ne 1 ] || [ "$BEND" -ne 1 ]
+then
+ echo "log8" "$RET" "$META" "$BEND"
+ bstat=$((bstat+64))
+fi
+
+MINFO=$(grep -c M_INFO ${cwd}/tmp/log8.out)
+MWARNING=$(grep -c M_WARNING ${cwd}/tmp/log8.out)
+MSAVED=$(grep -c M_SAVED ${cwd}/tmp/log8.out)
+MNOTSAVED=$(grep -c M_NOTSAVED ${cwd}/tmp/log8.out)
+if [ "$MINFO" -ne 1 ] || [ "$MWARNING" -ne 1 ] || [ "$MNOTSAVED" -ne 1 ]
+then
+ echo "log8msg" "$MINFO" "$MWARNING" "$MNOTSAVED"
+ bstat=$((bstat+128))
+fi
+
EFILE1=$(grep -c vm1.iso ${cwd}/tmp/log3.out)
EFILE2=$(grep -c vm2.iso ${cwd}/tmp/log3.out)
EFILE3=$(grep -c lockfile ${cwd}/tmp/log3.out)