Sha256: 3b4ffa171ed57305fc7266be4c5821c62b2112f8b6d38d7b8f37fcdbf3445ede

Contents?: true

Size: 1.71 KB

Versions: 4

Compression:

Stored size: 1.71 KB

Contents

require 'spec_helper'

str = <<-EOH
Filesystem                         1024-blocks     Used Available Capacity Mounted on
/dev/mapper/vg_idefix-lv_root         51475068  8840540  40013088      19% /
tmpfs                                   509696      872    508824       1% /dev/shm
/dev/sdb3                               487652   124828    337224      28% /boot
/dev/mapper/vg_idefix-lv_home         20857444 17905852   1885404      91% /home
EOH


describe Specinfra::HostInventory::Filesystem do
  let(:host_inventory) { nil }
  describe 'Example of CentOS 6.6 Kernel version 2.6.32-504.23.4.el6.i686' do
    ret = Specinfra::HostInventory::Filesystem.new(host_inventory).parse(str.split(/\n/))
    example do
      expect(ret["/dev/mapper/vg_idefix-lv_root"]).to include(
        "kb_used"      => "8840540",
        "kb_size"      => "51475068",
        "kb_available" => "40013088",
        "mount"        => "/",
        "percent_used" => "19%"
      )
    end
    example do
      expect(ret["/dev/sdb3"]).to include(
        "kb_used"      => "124828",
        "kb_size"      => "487652",
        "kb_available" => "337224",
        "mount"        => "/boot",
        "percent_used" => "28%"
      )
    end
    example do
      expect(ret["tmpfs"]).to include(
        "kb_used"      => "872",
        "kb_size"      => "509696",
        "kb_available" => "508824",
        "mount"        => "/dev/shm",
        "percent_used" => "1%"
      )
    end
    example do
      expect(ret["/dev/mapper/vg_idefix-lv_home"]).to include(
        "kb_used"      => "17905852",
        "kb_size"      => "20857444",
        "kb_available" => "1885404",
        "mount"        => "/home",
        "percent_used" => "91%"
      )
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
specinfra-2.36.4 spec/host_inventory/filesystem_spec.rb
specinfra-2.36.3 spec/host_inventory/filesystem_spec.rb
specinfra-2.36.2 spec/host_inventory/filesystem_spec.rb
specinfra-2.36.1 spec/host_inventory/filesystem_spec.rb