Sha256: 230d78f64a3ab5f8ff0f54c1aa2342a8f48ab71275b4f74916af9bb5e1b84e0e

Contents?: true

Size: 1.8 KB

Versions: 217

Compression:

Stored size: 1.8 KB

Contents

require 'spec_helper'

## Output from 'df -P'
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)
    example "/dev/mapper/vg_idefix-lv_home" 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
    example "/dev/mapper/vg_idefix-lv_root" 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 "/dev/sdb3" do
      expect(ret["/dev/sdb3"]).to include(
        "kb_used"      => "124828",
        "kb_size"      => "487652",
        "kb_available" => "337224",
        "mount"        => "/boot",
        "percent_used" => "28%"
      )
    end
    example "tmpfs" do
      expect(ret["tmpfs"]).to include(
        "kb_used"      => "872",
        "kb_size"      => "509696",
        "kb_available" => "508824",
        "mount"        => "/dev/shm",
        "percent_used" => "1%"
      )
    end
  end
end

Version data entries

217 entries across 217 versions & 3 rubygems

Version Path
specinfra-2.82.5 spec/host_inventory/linux/filesystem_spec.rb
specinfra-2.82.4 spec/host_inventory/linux/filesystem_spec.rb
specinfra-2.82.3 spec/host_inventory/linux/filesystem_spec.rb
specinfra-2.82.2 spec/host_inventory/linux/filesystem_spec.rb
specinfra-2.82.1 spec/host_inventory/linux/filesystem_spec.rb
specinfra-2.82.0 spec/host_inventory/linux/filesystem_spec.rb
specinfra-2.81.0 spec/host_inventory/linux/filesystem_spec.rb
specinfra-2.80.0 spec/host_inventory/linux/filesystem_spec.rb
specinfra-2.79.0 spec/host_inventory/linux/filesystem_spec.rb
specinfra-2.78.2 spec/host_inventory/linux/filesystem_spec.rb
specinfra-2.78.1 spec/host_inventory/linux/filesystem_spec.rb
specinfra-2.78.0 spec/host_inventory/linux/filesystem_spec.rb
specinfra-2.77.3 spec/host_inventory/linux/filesystem_spec.rb
specinfra-2.77.2 spec/host_inventory/linux/filesystem_spec.rb
specinfra-2.77.1 spec/host_inventory/linux/filesystem_spec.rb
specinfra-2.77.0 spec/host_inventory/linux/filesystem_spec.rb
specinfra-2.76.9 spec/host_inventory/linux/filesystem_spec.rb
specinfra-2.76.8 spec/host_inventory/linux/filesystem_spec.rb
specinfra-2.76.7 spec/host_inventory/linux/filesystem_spec.rb
specinfra-2.76.6 spec/host_inventory/linux/filesystem_spec.rb