fills, it will ask for a second, and after writing a few more \n\
blocks, it will stop. Then it will begin re-reading the\n\
two tapes.\n\n\
-This may take a long time. I.e. hours! ...\n\n");
+This may take a long time -- hours! ...\n\n");
get_cmd("Insert a blank tape then indicate if you want\n"
"to run the simplified test (s) with one tape or\n"
strerror_dev(dev));
ok = FALSE;
}
+ Pmsg0(-1, "Wrote session label.\n");
memset(&rec, 0, sizeof(rec));
rec.data = get_memory(100000); /* max record size */
*/
uint64_t *lp = (uint64_t *)rec.data;
for (uint32_t i=0; i < (REC_SIZE-sizeof(uint64_t))/sizeof(uint64_t); i++) {
- *lp++ = file_index;
+ *lp++ = ~file_index;
}
Dmsg4(250, "before writ_rec FI=%d SessId=%d Strm=%s len=%d\n",
if (now <= 0) {
now = 1;
}
- kbs = (double)dev->VolCatInfo.VolCatBytes / (1000 * now);
- Pmsg3(000, "Wrote block=%u, VolBytes=%s rate=%.1f KB/s\n", block->BlockNumber,
+ kbs = (double)dev->VolCatInfo.VolCatBytes / (1000.0 * (double)now);
+ Pmsg3(-1, "Wrote block=%u, VolBytes=%s rate=%.1f KB/s\n", block->BlockNumber,
edit_uint64_with_commas(dev->VolCatInfo.VolCatBytes, ec1), (float)kbs);
}
- /* Every 50000 blocks (approx 3.2MB) write an eof.
+ /* Every 15000 blocks (approx 1GB) write an eof.
*/
- if ((block->BlockNumber % 50000) == 0) {
- Pmsg0(000, "Flush block, write EOF\n");
+ if ((block->BlockNumber % 15000) == 0) {
+ Pmsg0(-1, "Flush block, write EOF\n");
flush_block(block, 0);
weof_dev(dev, 1);
/* The weof resets the block number */
}
/* Write out final block of this session */
if (!write_block_to_device(jcr, dev, block)) {
- Pmsg0(000, _("Set ok=FALSE after write_block_to_device.\n"));
+ Pmsg0(-1, _("Set ok=FALSE after write_block_to_device.\n"));
ok = FALSE;
}
}
/* Release the device */
if (!release_device(jcr, dev)) {
- Pmsg0(000, _("Error in release_device\n"));
+ Pmsg0(-1, _("Error in release_device\n"));
ok = FALSE;
}
dev->capabilities &= ~CAP_LABEL; /* don't label anything here */
end_of_tape = 0;
- if (!simple) {
- get_cmd(_("Mount first of two tapes. Press enter when ready: "));
- }
+
+ get_cmd(_("Mount first tape. Press enter when ready: "));
free_vol_list(jcr);
pm_strcpy(&jcr->VolumeName, "TestVolume1");
close_dev(dev);
dev->state &= ~ST_READ;
if (!acquire_device_for_read(jcr, dev, block)) {
- Pmsg0(000, dev->errmsg);
+ Pmsg1(-1, "%s", dev->errmsg);
return;
}
Pmsg1(-1, _("At block %u\n"), i);
}
}
- dump_block(last_block, _("Last block written"));
- dump_block(block, _("Block read back"));
- Pmsg0(-1, _("Except for the buffer address, the contents of\n"
- "the above two block dumps should be the same.\n"
- "If not you have a problem ...\n"));
+ if (last_block != 0) {
+ dump_block(last_block, _("Last block written"));
+ dump_block(block, _("Block read back"));
+ Pmsg0(-1, _("Except for the buffer address, the contents of\n"
+ "the above two block dumps should be the same.\n"
+ "If not you have a problem ...\n"));
+ }
}
bail_out:
/*
- * We are called here from "unfill" for each record on the
- * tape.
+ * We are called here from "unfill" for each record on the tape.
*/
static void record_cb(JCR *jcr, DEVICE *dev, DEV_BLOCK *block, DEV_RECORD *rec)
{
* Now check that the right data is in the record.
*/
uint64_t *lp = (uint64_t *)rec->data;
+ uint64_t val = ~file_index;
for (uint32_t i=0; i < (REC_SIZE-sizeof(uint64_t))/sizeof(uint64_t); i++) {
- if (*lp++ != (uint64_t)file_index) {
+ if (*lp++ != val) {
Pmsg2(000, "Record %d contains bad data in Block %u.\n",
file_index, block->BlockNumber);
break;
int dir_ask_sysop_to_mount_volume(JCR *jcr, DEVICE *dev)
{
- Pmsg0(000, dev->errmsg); /* print reason */
+ Pmsg1(-1, "%s", dev->errmsg); /* print reason */
fprintf(stderr, "Mount Volume \"%s\" on device %s and press return when ready: ",
jcr->VolumeName, dev_name(dev));
getchar();
dev_name(dev));
getchar();
VolumeName = "TestVolume2";
+ pm_strcpy(&jcr->VolumeName, "TestVolume2");
labelcmd();
VolumeName = NULL;
return 1;
if (now <= 0) {
now = 1;
}
- kbs = (double)VolBytes / (1000 * now);
- Pmsg3(000, "Read block=%u, VolBytes=%s rate=%.1f KB/s\n", block->BlockNumber,
+ kbs = (double)VolBytes / (1000.0 * (double)now);
+ Pmsg3(-1, "Read block=%u, VolBytes=%s rate=%.1f KB/s\n", block->BlockNumber,
edit_uint64_with_commas(VolBytes, ec1), (float)kbs);
if (strcmp(jcr->VolumeName, "TestVolume2") == 0) {