Resolve "kea-admin lease-upload fails if CSV file contains duplicate leases"

Merged Andrei Pavel requested to merge 2293-kea-admin-lease-upload-duplicate-leases into master

Closes #2293 (closed).

  • c52f590b call kea-lfc in kea-admin lease-upload
    • One thing here is the placement of temporary files in /tmp rather than in the same directory. I've done this in lease-upload and also changed it in lease-dump for consistency. This tries to address various permission problems that were mentioned in another issue. On one hand, the user might not have permission to write to the same directory as was done before in lease-dump. On the other, it just delays the write to the actual file further, so not much progress is actually done. However, lease-upload does succeed this way if the user does not have write permissions to the directory.
  • 3116ab4e adjust tests for kea-lfc called in kea-admin lease-upload
    • LFC formats the user context, probably through .toElement()->str() which spaces it out more, so I had to adjust CSV reference files and some inserts in tests. You can remove these spacings to see the failure.
    • LFC did not load the second row in lease6_dump_test.reference.csv. It complains with Empty DUIDs not allowed. So I added a DUID.
  • 30368501 assume a default for kea-admin on non-interactive shells
    • This commit is extraneous to the issue, but please read the story first. While developing I had unit tests block in the Do you want to continue? question because a file would be left from a previous test failure. The question did not even appear probably due to flushing problems that I don't know how to fix off the top of my head. What I thought happened was that the tests ran in a non-interactive shell and I thought I would fix that. It turned out not to be a problem and the proper fix was the rm -f "${output_file}" at the beginning of the text, see the associated comment. But I thought I would keep the non-interactive fix too.
Edited by Andrei Pavel

Merge request reports