Skip to content

Commit

Permalink
Merge pull request #167 from bareos/dev/arogge/master/fix-1030
Browse files Browse the repository at this point in the history
Fix #1030: bscan does not work for migration and copy jobs
  • Loading branch information
arogge committed Apr 10, 2019
2 parents cfc97d3 + 1e9af0f commit 0af8e5d
Show file tree
Hide file tree
Showing 217 changed files with 3,154 additions and 203 deletions.
2 changes: 0 additions & 2 deletions core/src/stored/bscan.cc
Expand Up @@ -794,8 +794,6 @@ static bool RecordCb(DeviceControlRecord* dcr, DeviceRecord* rec)
Pmsg1(0, _("Could not update job record. ERR=%s\n"),
db->strerror());
}
mjcr->read_dcr = NULL;
FreeJcr(mjcr);
}
}
mr.VolFiles = rec->File;
Expand Down
21 changes: 10 additions & 11 deletions core/src/stored/mac.cc
Expand Up @@ -146,13 +146,16 @@ static bool CloneRecordInternally(DeviceControlRecord* dcr, DeviceRecord* rec)

UnserSessionLabel(label, rec);

/*
* set job info from first SOS label
*/
if (jcr->is_JobType(JT_MIGRATE) || jcr->is_JobType(JT_COPY)) {
bstrncpy(jcr->Job, label->Job, sizeof(jcr->Job));
PmStrcpy(jcr->job_name, label->JobName);
PmStrcpy(jcr->client_name, label->ClientName);
PmStrcpy(jcr->fileset_name, label->FileSetName);
PmStrcpy(jcr->fileset_md5, label->FileSetMD5);
}
jcr->setJobType(label->JobType);
jcr->setJobLevel(label->JobLevel);
Dmsg1(200, "joblevel from SOS_LABEL is now %c\n", label->JobLevel);
bstrncpy(jcr->Job, label->Job, sizeof(jcr->Job));

if (label->VerNum >= 11) {
jcr->sched_time = BtimeToUnix(label->write_btime);
Expand All @@ -176,15 +179,11 @@ static bool CloneRecordInternally(DeviceControlRecord* dcr, DeviceRecord* rec)
}
} else {
Dmsg0(200, "Found additional SOS_LABEL, ignoring! \n");
retval = true;
goto bail_out;
}

} else {
/* Other label than SOS -> skip */
retval = true;
goto bail_out;
}
/* Other label than SOS -> skip */
retval = true;
goto bail_out;
}

/*
Expand Down
6 changes: 6 additions & 0 deletions systemtests/CMakeLists.txt
Expand Up @@ -163,6 +163,11 @@ set(SYSTEM_TESTS
backup-bareos-test
backup-bareos-passive-test
multiplied-device-test
virtualfull
virtualfull-bscan
backup-bscan
copy-bscan
copy-remote-bscan
)

set(BASEPORT 42001)
Expand Down Expand Up @@ -191,6 +196,7 @@ foreach(TEST_NAME ${SYSTEM_TESTS})
math(EXPR dir_port "${BASEPORT} + 0")
math(EXPR fd_port "${BASEPORT} + 1")
math(EXPR sd_port "${BASEPORT} + 2")
math(EXPR sd2_port "${BASEPORT} + 3")


# set(DEFAULT_DB_TYPE )
Expand Down
3 changes: 3 additions & 0 deletions systemtests/environment.in
Expand Up @@ -5,6 +5,7 @@ db_password="@db_password@"

PROJECT_BINARY_DIR=@PROJECT_BINARY_DIR@
bin=${PROJECT_BINARY_DIR}/bin
sbin=${PROJECT_BINARY_DIR}/sbin

current_test_directory=${PROJECT_BINARY_DIR}/tests/@TEST_NAME@

Expand All @@ -19,6 +20,7 @@ tmp=${current_test_directory}/tmp


dumps=${current_test_directory}/dumps
backenddir=@backenddir@
plugindir=${PROJECT_BINARY_DIR}/plugins
plugindirtmp=${PROJECT_BINARY_DIR}/pluginstmp
rscripts=${PROJECT_BINARY_DIR}/scripts
Expand All @@ -39,6 +41,7 @@ export BAREOS_WORKING_DIR=${working}
export BASEPORT=@BASEPORT@
export BAREOS_DIRECTOR_PORT=@dir_port@
export BAREOS_STORAGE_PORT=@sd_port@
export BAREOS_STORAGE2_PORT=@sd2_port@
export BAREOS_FD_PORT=@fd_port@
export PIDDIR=@piddir@

Expand Down

0 comments on commit 0af8e5d

Please sign in to comment.