Sha256: 3e0f41b255eced8296ef1dc974557f89c960a9427906b83c2513acd19ec9d53f

Contents?: true

Size: 737 Bytes

Versions: 1

Compression:

Stored size: 737 Bytes

Contents

Before do
  @aruba_timeout_seconds = 10
end

Given(/^the zpool "(.*?)" has a capacity of (\d+)%$/) do |name, capacity|
  cmd = "zpool list -H -o name,cap #{name}"
  out = "#{name}\t#{capacity}%\n"
  double_cmd(cmd, :puts => out)
end

Given(/^the health from zpool "(.*?)" is "(.*?)"$/) do |name, health|
  cmd = "zpool list -H -o health #{name}"
  double_cmd(cmd, :puts => "#{health}\n")
end

Then(/^the status should be (unknown|critical|warning|ok)$/) do |status|
  exit_status =
    case status
    when 'unknown'  then 3
    when 'critical' then 2
    when 'warning'  then 1
    when 'ok'       then 0
    end
  steps %Q(
    Then the exit status should be #{exit_status}
    And the stdout should contain "#{status.upcase}"
  )
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nagios-zfs-0.2.0 features/step_definitions/dev_steps.rb