Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-125

Storage report output text incorret

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Low
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Promise type: storage
    • Labels:
      None
    • Found in version (details):
      3.3.3

      Description

      The output text for storage reports is incorrect, making other checks suspect.

      Here is a test system, showing 'df' output in bytes:

      1. df -B 1 /boot
        Filesystem 1B-blocks Used Available Use% Mounted on
        /dev/sda1 203097088 73252864 119358464 39% /boot

      And the same in MB:

      1. df -B 1M /boot
        Filesystem 1M-blocks Used Available Use% Mounted on
        /dev/sda1 194 70 114 39% /boot

      Promise to check on disk space. This should fail, because we want 200MB, but the there are only 114MB free.

      storage:
      host::
      "/boot"
      volume => min_free_space("200M"),
      classes => if_notkept("boot_not_good");

      reports:

      !boot_not_good::
      "/boot is okay!";
      boot_not_good::
      "/boot NOT okay!";

      The output:

      -> Filesystem /boot's content seems to be sensible as promised
      R: /boot is okay!

      Now, if I increase the counts by a factor of 1024, to check for 200G, I get this output:

      -> Filesystem /boot's content seems to be sensible as promised
      !! Disk space under 209715200 kB for volume containing /boot (119358464 kB free)
      R: /boot NOT okay!

      There are two things wrong here:

      1) the free space for boot is apparently assumed to be in KB, which is wrong by quite a bit.
      2) the documentation for storage promises (https://cfengine.com/manuals/cf3-Reference#volume-in-storage) makes no mention of the units that are used internally for comparison (not that it should matter, I suppose).

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              hawson Jesse becker
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Summary Panel