[Problem] If you manually remove contents of /opt/data/ckm/ initial-values
tests will fail because the target directory does not exist.
[Solution] Add asserts checking if input & output files are correct.
[Verification] Remove /otp/data/ckm/initial_values. Run:
ckm-tests --group=T60_INITIAL_VALUES. They should fail. Reinstall key-manager
run tests again. All should pass.
Change-Id: Ib6b7308747b74943ec9d7274284d1d56c9be1641
void copy_file(const std::string &from, const std::string &to)
{
std::ifstream infile(from, std::ios_base::binary);
+ RUNNER_ASSERT_MSG(infile, "Input file " << from << " does not exist.");
std::ofstream outfile(to, std::ios_base::binary);
+ RUNNER_ASSERT_MSG(outfile, "Output file " << to << " does not exist. Reinstall key-manager.");
outfile << infile.rdbuf();
}