Adjust current size of total dump files in dump directory

Symptom:
"Verify Maximum BMC Dump Creation" test item got failed sometimes.
This test item expect that dump space is enough to create a new BMC dump file.
But, dump manager doesn't think dump space is enough to create
according to current size of dump directory.

Root cause:
dump manager is using std::filesystem::file_size to calculate total size of
dump log files in dump directory. Then total size is divided by 1024
convert to KB. However, test item is using linux command "du -s" to calculate
total size of dump log files in dump directory.
The calculation result is different between dump manager and test item
then cause test got failed sometimes.

Solution:
calculate each dump file with std::ceil() and convert size to KB then
calculate total dump files size in dump directory. That's can reduce size
difference of total dump files between dump manager
and test item then avoid this test got failed.

Tested:
Run 3~4 times robot
Verify_Maximum_BMC_Dump_Creation redfish/managers/test_bmc_dumps.robot
Verify Maximum BMC Dump Creation :: Create maximum BMC dump and ve... | PASS |
1 critical test, 1 passed, 0 failed
1 test total, 1 passed, 0 failed

Signed-off-by: Tim Lee <timlee660101@gmail.com>
Change-Id: Ic1a6d941d12516678ff21789355941653d319858
1 file changed
tree: 38f051438e88768e4c6ac767814ce7b814a77854
  1. dump-extensions/
  2. host-transport-extensions/
  3. test/
  4. tools/
  5. xyz/
  6. .clang-format
  7. .gitignore
  8. bmc_dump_entry.cpp
  9. bmc_dump_entry.hpp
  10. core_manager.cpp
  11. core_manager.hpp
  12. core_manager_main.cpp
  13. dump-extensions.hpp
  14. dump_entry.cpp
  15. dump_entry.hpp
  16. dump_internal.hpp
  17. dump_manager.cpp
  18. dump_manager.hpp
  19. dump_manager_bmc.cpp
  20. dump_manager_bmc.hpp
  21. dump_manager_main.cpp
  22. dump_offload.cpp
  23. dump_offload.hpp
  24. dump_serialize.cpp
  25. dump_serialize.hpp
  26. dump_utils.cpp
  27. dump_utils.hpp
  28. elog_watch.cpp
  29. elog_watch.hpp
  30. errors_map.mako.hpp
  31. errors_map_gen.py
  32. example_errors_watch.yaml
  33. ffdc
  34. host_transport_exts.hpp
  35. LICENSE
  36. MAINTAINERS
  37. meson.build
  38. meson_options.txt
  39. README.md
  40. watch.cpp
  41. watch.hpp
README.md

phosphor-debug-collector

Phosphor Debug Collector provides mechanisms to collect various log files and system parameters. Used to troubleshoot problems in OpenBMC based systems.

To Build

To build this package with meson, do the following steps:

    1. meson builddir
    2. ninja -C builddir

To clean the built files run ninja -C builddir clean.

To run unit tests

Tests can be run in the CI docker container, refer local-ci-build

or with an OpenBMC x86 sdk(see below for x86 steps).

meson -Doe-sdk=enabled -Dtests=enabled build
ninja -C build test