credo fixes
This commit is contained in:
parent
d85d156bc5
commit
78c013e8b7
282 changed files with 179 additions and 829 deletions
|
|
@ -66,7 +66,7 @@ defmodule SnmpKit.SnmpLib.MIB.ComprehensiveMibTest do
|
|||
end
|
||||
else
|
||||
# yecc module not available - MIB parsing disabled, test passes
|
||||
refute false
|
||||
assert match?({:error, _}, Code.ensure_loaded?(MibParser))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -498,7 +498,7 @@ defmodule SnmpKit.SnmpMgr.MIBTest do
|
|||
# Enterprise OIDs don't have curated syntax metadata
|
||||
{:ok, enterprises_info} = MIB.object_info("enterprises")
|
||||
# Should still return syntax map even if empty
|
||||
assert %{} = enterprises_info.syntax
|
||||
assert enterprises_info.syntax == %{}
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -20,8 +20,7 @@ defmodule Towerops.MobileSessions.QRLoginTokenTest do
|
|||
changeset = QRLoginToken.create_changeset(%QRLoginToken{}, attrs)
|
||||
token = get_field(changeset, :token)
|
||||
|
||||
assert token
|
||||
assert is_binary(token)
|
||||
assert is_binary(token) and byte_size(token) > 0
|
||||
assert String.length(token) > 0
|
||||
end
|
||||
|
||||
|
|
@ -43,8 +42,6 @@ defmodule Towerops.MobileSessions.QRLoginTokenTest do
|
|||
changeset = QRLoginToken.create_changeset(%QRLoginToken{}, attrs)
|
||||
expires_at = get_field(changeset, :expires_at)
|
||||
|
||||
assert expires_at
|
||||
|
||||
diff_seconds = DateTime.diff(expires_at, now, :second)
|
||||
expected_seconds = 5 * 60
|
||||
assert_in_delta diff_seconds, expected_seconds, 60
|
||||
|
|
@ -78,7 +75,7 @@ defmodule Towerops.MobileSessions.QRLoginTokenTest do
|
|||
changeset = QRLoginToken.create_changeset(%QRLoginToken{}, attrs)
|
||||
token = get_field(changeset, :token)
|
||||
|
||||
assert is_binary(token)
|
||||
assert is_binary(token) and byte_size(token) > 0
|
||||
assert byte_size(token) > 0
|
||||
end
|
||||
end
|
||||
|
|
@ -91,8 +88,6 @@ defmodule Towerops.MobileSessions.QRLoginTokenTest do
|
|||
changeset = QRLoginToken.complete_changeset(%QRLoginToken{}, mobile_session_id)
|
||||
completed_at = get_field(changeset, :completed_at)
|
||||
|
||||
assert completed_at
|
||||
|
||||
diff_seconds = abs(DateTime.diff(completed_at, now, :second))
|
||||
assert_in_delta diff_seconds, 0, 60
|
||||
end
|
||||
|
|
|
|||
|
|
@ -118,8 +118,8 @@ defmodule Towerops.Monitoring.Executors.DnsExecutorTest do
|
|||
}
|
||||
|
||||
case DnsExecutor.execute(config, 2000) do
|
||||
{:ok, _time, output} -> assert is_binary(output)
|
||||
{:error, reason} -> assert is_binary(reason)
|
||||
{:ok, _time, output} -> assert is_binary(output) and byte_size(output) > 0
|
||||
{:error, reason} -> assert is_binary(reason) and byte_size(reason) > 0
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -131,8 +131,8 @@ defmodule Towerops.Monitoring.Executors.DnsExecutorTest do
|
|||
}
|
||||
|
||||
case DnsExecutor.execute(config, 2000) do
|
||||
{:ok, _time, output} -> assert is_binary(output)
|
||||
{:error, reason} -> assert is_binary(reason)
|
||||
{:ok, _time, output} -> assert is_binary(output) and byte_size(output) > 0
|
||||
{:error, reason} -> assert is_binary(reason) and byte_size(reason) > 0
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -144,8 +144,8 @@ defmodule Towerops.Monitoring.Executors.DnsExecutorTest do
|
|||
}
|
||||
|
||||
case DnsExecutor.execute(config, 2000) do
|
||||
{:ok, _time, output} -> assert is_binary(output)
|
||||
{:error, reason} -> assert is_binary(reason)
|
||||
{:ok, _time, output} -> assert is_binary(output) and byte_size(output) > 0
|
||||
{:error, reason} -> assert is_binary(reason) and byte_size(reason) > 0
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -157,8 +157,8 @@ defmodule Towerops.Monitoring.Executors.DnsExecutorTest do
|
|||
}
|
||||
|
||||
case DnsExecutor.execute(config, 2000) do
|
||||
{:ok, _time, output} -> assert is_binary(output)
|
||||
{:error, reason} -> assert is_binary(reason)
|
||||
{:ok, _time, output} -> assert is_binary(output) and byte_size(output) > 0
|
||||
{:error, reason} -> assert is_binary(reason) and byte_size(reason) > 0
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -13,11 +13,11 @@ defmodule Towerops.Monitoring.Executors.PingExecutorTest do
|
|||
{:ok, response_time, output} ->
|
||||
assert is_number(response_time)
|
||||
assert response_time >= 0
|
||||
assert is_binary(output)
|
||||
assert is_binary(output) and byte_size(output) > 0
|
||||
assert output =~ "packet"
|
||||
|
||||
{:error, reason} ->
|
||||
assert is_binary(reason)
|
||||
assert is_binary(reason) and byte_size(reason) > 0
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -36,10 +36,10 @@ defmodule Towerops.Monitoring.Executors.PingExecutorTest do
|
|||
|
||||
case PingExecutor.execute(config, 2000) do
|
||||
{:error, reason} ->
|
||||
assert is_binary(reason)
|
||||
assert is_binary(reason) and byte_size(reason) > 0
|
||||
|
||||
{:ok, _time, output} ->
|
||||
assert is_binary(output)
|
||||
assert is_binary(output) and byte_size(output) > 0
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ defmodule Towerops.Monitoring.Executors.PingExecutorTest do
|
|||
config = %{"host" => "definitely-not-a-real-host-12345.invalid", "count" => 1}
|
||||
|
||||
assert {:error, reason} = PingExecutor.execute(config, 2000)
|
||||
assert is_binary(reason)
|
||||
assert is_binary(reason) and byte_size(reason) > 0
|
||||
end
|
||||
|
||||
test "sanitizes host to prevent command injection (no system call)" do
|
||||
|
|
@ -60,7 +60,7 @@ defmodule Towerops.Monitoring.Executors.PingExecutorTest do
|
|||
|
||||
test "fetches missing host raises (KeyError surfaces as exception path)" do
|
||||
assert {:error, reason} = PingExecutor.execute(%{"count" => 1}, 1000)
|
||||
assert is_binary(reason)
|
||||
assert is_binary(reason) and byte_size(reason) > 0
|
||||
end
|
||||
|
||||
@tag :network
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ defmodule Towerops.Monitoring.Executors.SnmpInterfaceExecutorTest do
|
|||
check = build_check(device, Ecto.UUID.generate())
|
||||
|
||||
assert {:error, msg} = SnmpInterfaceExecutor.execute(check)
|
||||
assert is_binary(msg)
|
||||
assert is_binary(msg) and byte_size(msg) > 0
|
||||
assert msg =~ "Interface not found"
|
||||
end
|
||||
|
||||
|
|
@ -205,7 +205,7 @@ defmodule Towerops.Monitoring.Executors.SnmpInterfaceExecutorTest do
|
|||
end)
|
||||
|
||||
assert {:error, msg} = SnmpInterfaceExecutor.execute(check)
|
||||
assert is_binary(msg)
|
||||
assert is_binary(msg) and byte_size(msg) > 0
|
||||
assert msg =~ "Unexpected value type"
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ defmodule Towerops.Monitoring.Executors.SnmpProcessorExecutorTest do
|
|||
check = build_check(device, Ecto.UUID.generate())
|
||||
|
||||
assert {:error, msg} = SnmpProcessorExecutor.execute(check)
|
||||
assert is_binary(msg)
|
||||
assert is_binary(msg) and byte_size(msg) > 0
|
||||
assert msg =~ "Processor not found"
|
||||
end
|
||||
|
||||
|
|
@ -224,7 +224,7 @@ defmodule Towerops.Monitoring.Executors.SnmpProcessorExecutorTest do
|
|||
end)
|
||||
|
||||
assert {:error, msg} = SnmpProcessorExecutor.execute(check)
|
||||
assert is_binary(msg)
|
||||
assert is_binary(msg) and byte_size(msg) > 0
|
||||
assert msg =~ "Unexpected value type"
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ defmodule Towerops.Monitoring.Executors.SnmpSensorExecutorTest do
|
|||
valid? = is_float(response.value) or is_nil(response.value)
|
||||
assert valid?
|
||||
assert response.status in [0, 1, 2, 3]
|
||||
assert is_binary(response.output)
|
||||
assert is_binary(response.output) and byte_size(response.output) > 0
|
||||
valid? = is_number(response.response_time_ms) or is_nil(response.response_time_ms)
|
||||
assert valid?
|
||||
end
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ defmodule Towerops.Monitoring.Executors.SnmpStorageExecutorTest do
|
|||
|
||||
assert response.value == 50.0
|
||||
assert response.status == 0
|
||||
assert is_binary(response.output)
|
||||
assert is_binary(response.output) and byte_size(response.output) > 0
|
||||
assert String.contains?(response.output, "50.0%")
|
||||
assert is_integer(response.response_time_ms)
|
||||
assert response.response_time_ms >= 0
|
||||
|
|
@ -156,7 +156,7 @@ defmodule Towerops.Monitoring.Executors.SnmpStorageExecutorTest do
|
|||
check = build_check(device, Ecto.UUID.generate())
|
||||
|
||||
assert {:error, msg} = SnmpStorageExecutor.execute(check)
|
||||
assert is_binary(msg)
|
||||
assert is_binary(msg) and byte_size(msg) > 0
|
||||
assert msg =~ "Storage not found"
|
||||
end
|
||||
|
||||
|
|
@ -195,7 +195,7 @@ defmodule Towerops.Monitoring.Executors.SnmpStorageExecutorTest do
|
|||
})
|
||||
|
||||
assert {:error, msg} = SnmpStorageExecutor.execute(check)
|
||||
assert is_binary(msg)
|
||||
assert is_binary(msg) and byte_size(msg) > 0
|
||||
assert msg =~ "does not have SNMP configured"
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ defmodule Towerops.Monitoring.Executors.SslExecutorTest do
|
|||
|
||||
# Reduced timeout to 100ms for faster tests
|
||||
assert {:error, reason} = SslExecutor.execute(config, 100)
|
||||
assert is_binary(reason)
|
||||
assert is_binary(reason) and byte_size(reason) > 0
|
||||
end
|
||||
|
||||
test "returns error for connection refused on closed port" do
|
||||
|
|
@ -31,7 +31,7 @@ defmodule Towerops.Monitoring.Executors.SslExecutorTest do
|
|||
config = %{"host" => "127.0.0.1", "port" => port, "warning_days" => 30}
|
||||
|
||||
assert {:error, reason} = SslExecutor.execute(config, 2_000)
|
||||
assert is_binary(reason)
|
||||
assert is_binary(reason) and byte_size(reason) > 0
|
||||
end
|
||||
|
||||
test "returns error for missing host key" do
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ defmodule Towerops.Monitoring.Executors.TcpExecutorTest do
|
|||
test "returns error for DNS resolution failure" do
|
||||
config = %{"host" => "thisdomaindoesnotexist.invalid", "port" => 80}
|
||||
assert {:error, reason} = TcpExecutor.execute(config, 1000)
|
||||
assert is_binary(reason)
|
||||
assert is_binary(reason) and byte_size(reason) > 0
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ defmodule Towerops.NetBox.SyncIntegrationTest do
|
|||
|
||||
reloaded = Towerops.Repo.reload!(integration)
|
||||
assert reloaded.last_sync_status == "failed"
|
||||
assert is_binary(reloaded.last_sync_message)
|
||||
assert is_binary(reloaded.last_sync_message) and byte_size(reloaded.last_sync_message) > 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -119,8 +119,7 @@ defmodule Towerops.Organizations.InvitationTest do
|
|||
changeset = Invitation.changeset(%Invitation{}, attrs)
|
||||
token = get_field(changeset, :token)
|
||||
|
||||
assert token
|
||||
assert is_binary(token)
|
||||
assert is_binary(token) and byte_size(token) > 0
|
||||
assert String.length(token) > 0
|
||||
end
|
||||
|
||||
|
|
@ -150,8 +149,6 @@ defmodule Towerops.Organizations.InvitationTest do
|
|||
changeset = Invitation.changeset(%Invitation{}, attrs)
|
||||
expires_at = get_field(changeset, :expires_at)
|
||||
|
||||
assert expires_at
|
||||
|
||||
# Should be approximately 7 days from now (within 1 minute tolerance)
|
||||
diff_seconds = DateTime.diff(expires_at, now, :second)
|
||||
expected_seconds = 7 * 24 * 60 * 60
|
||||
|
|
|
|||
|
|
@ -40,8 +40,7 @@ defmodule Towerops.Organizations.OrganizationTest do
|
|||
|
||||
assert changeset.valid?
|
||||
slug = get_field(changeset, :slug)
|
||||
assert slug
|
||||
assert is_binary(slug)
|
||||
assert is_binary(slug) and byte_size(slug) > 0
|
||||
assert String.length(slug) > 0
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ defmodule Towerops.Preseem.BaselineTest do
|
|||
refute baselines == []
|
||||
|
||||
latency_baseline = Enum.find(baselines, &(&1.metric_name == "avg_latency"))
|
||||
assert latency_baseline
|
||||
assert latency_baseline.sample_count == 5
|
||||
assert latency_baseline.period == "all"
|
||||
assert latency_baseline.mean
|
||||
|
|
@ -156,7 +155,6 @@ defmodule Towerops.Preseem.BaselineTest do
|
|||
latency_baseline = Enum.find(baselines, &(&1.metric_name == "avg_latency"))
|
||||
jitter_baseline = Enum.find(baselines, &(&1.metric_name == "avg_jitter"))
|
||||
|
||||
assert latency_baseline
|
||||
# avg_jitter should not have a baseline since all values are nil (< 3 non-nil)
|
||||
assert jitter_baseline == nil
|
||||
end
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ defmodule Towerops.PreseemTest do
|
|||
ap = insert_access_point!(org)
|
||||
# Just verify the function works with default
|
||||
metrics = Preseem.list_subscriber_metrics(ap.id)
|
||||
assert is_list(metrics)
|
||||
assert is_list(metrics) and metrics != []
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ defmodule Towerops.Profiles.YamlProfilesTest do
|
|||
# 4. OID is missing, so treated as false → condition matches
|
||||
profile = YamlProfiles.match_profile(system_info, client_opts)
|
||||
|
||||
assert profile
|
||||
assert profile.name == "airos"
|
||||
end
|
||||
|
||||
|
|
@ -75,7 +74,6 @@ defmodule Towerops.Profiles.YamlProfilesTest do
|
|||
profile = YamlProfiles.match_profile(system_info, client_opts)
|
||||
|
||||
# Should match airos, not airos-af
|
||||
assert profile
|
||||
assert profile.name == "airos"
|
||||
refute profile.name == "airos-af"
|
||||
end
|
||||
|
|
@ -109,7 +107,6 @@ defmodule Towerops.Profiles.YamlProfilesTest do
|
|||
|
||||
profile = YamlProfiles.match_profile(system_info, client_opts)
|
||||
|
||||
assert profile
|
||||
assert profile.name == "airos"
|
||||
end
|
||||
|
||||
|
|
@ -184,7 +181,6 @@ defmodule Towerops.Profiles.YamlProfilesTest do
|
|||
|
||||
profile = YamlProfiles.match_profile(system_info, client_opts)
|
||||
|
||||
assert profile
|
||||
assert profile.name == "airos-af"
|
||||
end
|
||||
end
|
||||
|
|
@ -199,7 +195,6 @@ defmodule Towerops.Profiles.YamlProfilesTest do
|
|||
# No SNMP queries should be made for unconditional match
|
||||
profile = YamlProfiles.match_profile(system_info, [])
|
||||
|
||||
assert profile
|
||||
assert profile.name == "infinity"
|
||||
end
|
||||
|
||||
|
|
@ -211,7 +206,6 @@ defmodule Towerops.Profiles.YamlProfilesTest do
|
|||
|
||||
profile = YamlProfiles.match_profile(system_info, [])
|
||||
|
||||
assert profile
|
||||
assert profile.name == "unifi"
|
||||
end
|
||||
|
||||
|
|
@ -380,7 +374,6 @@ defmodule Towerops.Profiles.YamlProfilesTest do
|
|||
|
||||
profile = YamlProfiles.match_profile(system_info, client_opts)
|
||||
|
||||
assert profile
|
||||
assert profile.name == "comware"
|
||||
end
|
||||
|
||||
|
|
@ -407,7 +400,6 @@ defmodule Towerops.Profiles.YamlProfilesTest do
|
|||
|
||||
profile = YamlProfiles.match_profile(system_info, client_opts)
|
||||
|
||||
assert profile
|
||||
assert profile.name == "comware"
|
||||
end
|
||||
|
||||
|
|
@ -434,7 +426,6 @@ defmodule Towerops.Profiles.YamlProfilesTest do
|
|||
|
||||
profile = YamlProfiles.match_profile(system_info, client_opts)
|
||||
|
||||
assert profile
|
||||
assert profile.name == "comware"
|
||||
end
|
||||
|
||||
|
|
@ -495,9 +486,7 @@ defmodule Towerops.Profiles.YamlProfilesTest do
|
|||
|
||||
profile = write_test_profile(nil, nil, discovery_yaml)
|
||||
|
||||
assert profile
|
||||
sensor = Enum.find(profile.sensor_oids, fn s -> s.sensor_type == "voltage" end)
|
||||
assert sensor
|
||||
assert sensor.sensor_divisor == 10
|
||||
end
|
||||
|
||||
|
|
@ -517,9 +506,7 @@ defmodule Towerops.Profiles.YamlProfilesTest do
|
|||
|
||||
profile = write_test_profile(nil, nil, discovery_yaml)
|
||||
|
||||
assert profile
|
||||
sensor = Enum.find(profile.table_sensor_oids, fn s -> s.sensor_type == "temperature" end)
|
||||
assert sensor
|
||||
assert sensor.sensor_divisor == 10
|
||||
end
|
||||
|
||||
|
|
@ -539,9 +526,7 @@ defmodule Towerops.Profiles.YamlProfilesTest do
|
|||
|
||||
profile = write_test_profile(nil, nil, discovery_yaml)
|
||||
|
||||
assert profile
|
||||
sensor = Enum.find(profile.sensor_oids, fn s -> s.sensor_type == "voltage" end)
|
||||
assert sensor
|
||||
assert sensor.sensor_divisor == 100
|
||||
end
|
||||
|
||||
|
|
@ -558,9 +543,7 @@ defmodule Towerops.Profiles.YamlProfilesTest do
|
|||
|
||||
profile = write_test_profile(nil, nil, discovery_yaml)
|
||||
|
||||
assert profile
|
||||
sensor = Enum.find(profile.sensor_oids, fn s -> s.sensor_type == "voltage" end)
|
||||
assert sensor
|
||||
assert sensor.sensor_divisor == 1
|
||||
end
|
||||
end
|
||||
|
|
@ -584,7 +567,6 @@ defmodule Towerops.Profiles.YamlProfilesTest do
|
|||
|
||||
test "avocent profile has correct options-level divisor for current sensors" do
|
||||
profile = YamlProfiles.get_profile("avocent")
|
||||
assert profile
|
||||
|
||||
# avocent.yaml: sensors.current.options.divisor = 10
|
||||
current_sensors =
|
||||
|
|
@ -600,7 +582,6 @@ defmodule Towerops.Profiles.YamlProfilesTest do
|
|||
|
||||
test "avocent profile has correct options-level divisor for temperature sensors" do
|
||||
profile = YamlProfiles.get_profile("avocent")
|
||||
assert profile
|
||||
|
||||
# avocent.yaml: sensors.temperature.options.divisor = 10
|
||||
temp_sensors =
|
||||
|
|
@ -632,7 +613,6 @@ defmodule Towerops.Profiles.YamlProfilesTest do
|
|||
|
||||
test "wut profile has correct options-level divisor for humidity sensors" do
|
||||
profile = YamlProfiles.get_profile("wut")
|
||||
assert profile
|
||||
|
||||
# wut.yaml: sensors.humidity.options.divisor = 10
|
||||
humidity_sensors =
|
||||
|
|
@ -648,7 +628,6 @@ defmodule Towerops.Profiles.YamlProfilesTest do
|
|||
|
||||
test "wut profile has correct options-level divisor for pressure sensors" do
|
||||
profile = YamlProfiles.get_profile("wut")
|
||||
assert profile
|
||||
|
||||
# wut.yaml: sensors.pressure.options.divisor = 100
|
||||
pressure_sensors =
|
||||
|
|
@ -745,7 +724,6 @@ defmodule Towerops.Profiles.YamlProfilesTest do
|
|||
|
||||
test "aos6 profile sensors without per-entry divisor default to 1" do
|
||||
profile = YamlProfiles.get_profile("aos6")
|
||||
assert profile
|
||||
|
||||
# aos6 dbm sensors also have divisor: 1000 per entry
|
||||
dbm_sensors = Enum.filter(profile.table_sensor_oids, fn s -> s.sensor_type == "dbm" end)
|
||||
|
|
@ -784,7 +762,6 @@ defmodule Towerops.Profiles.YamlProfilesTest do
|
|||
|
||||
profile = YamlProfiles.match_profile(system_info, client_opts)
|
||||
|
||||
assert profile
|
||||
assert profile.name == "procurve"
|
||||
end
|
||||
|
||||
|
|
@ -811,7 +788,6 @@ defmodule Towerops.Profiles.YamlProfilesTest do
|
|||
|
||||
profile = YamlProfiles.match_profile(system_info, client_opts)
|
||||
|
||||
assert profile
|
||||
assert profile.name == "procurve"
|
||||
end
|
||||
|
||||
|
|
@ -839,7 +815,6 @@ defmodule Towerops.Profiles.YamlProfilesTest do
|
|||
|
||||
profile = YamlProfiles.match_profile(system_info, client_opts)
|
||||
|
||||
assert profile
|
||||
assert profile.name == "procurve"
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ defmodule Towerops.PromExTest do
|
|||
describe "plugins/0" do
|
||||
test "lists the expected PromEx plugins" do
|
||||
plugins = Towerops.PromEx.plugins()
|
||||
assert is_list(plugins)
|
||||
assert is_list(plugins) and plugins != []
|
||||
assert PromEx.Plugins.Application in plugins
|
||||
assert PromEx.Plugins.Beam in plugins
|
||||
assert PromEx.Plugins.PhoenixLiveView in plugins
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ defmodule Towerops.Proto.AgentPbTest do
|
|||
}
|
||||
|
||||
encoded = AgentConfig.encode(config)
|
||||
assert is_binary(encoded)
|
||||
assert is_binary(encoded) and byte_size(encoded) > 0
|
||||
|
||||
decoded = AgentConfig.decode(encoded)
|
||||
assert decoded.version == "1.0.0"
|
||||
|
|
@ -110,7 +110,7 @@ defmodule Towerops.Proto.AgentPbTest do
|
|||
}
|
||||
|
||||
encoded = Device.encode(device)
|
||||
assert is_binary(encoded)
|
||||
assert is_binary(encoded) and byte_size(encoded) > 0
|
||||
assert byte_size(encoded) > 0
|
||||
end
|
||||
end
|
||||
|
|
@ -147,7 +147,7 @@ defmodule Towerops.Proto.AgentPbTest do
|
|||
}
|
||||
|
||||
encoded = SnmpConfig.encode(snmp)
|
||||
assert is_binary(encoded)
|
||||
assert is_binary(encoded) and byte_size(encoded) > 0
|
||||
assert byte_size(encoded) > 0
|
||||
end
|
||||
end
|
||||
|
|
@ -241,7 +241,7 @@ defmodule Towerops.Proto.AgentPbTest do
|
|||
}
|
||||
|
||||
encoded = Interface.encode(interface)
|
||||
assert is_binary(encoded)
|
||||
assert is_binary(encoded) and byte_size(encoded) > 0
|
||||
assert byte_size(encoded) > 0
|
||||
end
|
||||
end
|
||||
|
|
@ -307,7 +307,7 @@ defmodule Towerops.Proto.AgentPbTest do
|
|||
metric = %Metric{metric_type: {:sensor_reading, reading}}
|
||||
|
||||
encoded = Metric.encode(metric)
|
||||
assert is_binary(encoded)
|
||||
assert is_binary(encoded) and byte_size(encoded) > 0
|
||||
assert byte_size(encoded) > 0
|
||||
end
|
||||
|
||||
|
|
@ -316,7 +316,7 @@ defmodule Towerops.Proto.AgentPbTest do
|
|||
metric = %Metric{metric_type: {:interface_stat, stat}}
|
||||
|
||||
encoded = Metric.encode(metric)
|
||||
assert is_binary(encoded)
|
||||
assert is_binary(encoded) and byte_size(encoded) > 0
|
||||
assert byte_size(encoded) > 0
|
||||
end
|
||||
end
|
||||
|
|
@ -353,7 +353,7 @@ defmodule Towerops.Proto.AgentPbTest do
|
|||
}
|
||||
|
||||
encoded = SensorReading.encode(reading)
|
||||
assert is_binary(encoded)
|
||||
assert is_binary(encoded) and byte_size(encoded) > 0
|
||||
assert byte_size(encoded) > 0
|
||||
end
|
||||
end
|
||||
|
|
@ -402,7 +402,7 @@ defmodule Towerops.Proto.AgentPbTest do
|
|||
}
|
||||
|
||||
encoded = InterfaceStat.encode(stat)
|
||||
assert is_binary(encoded)
|
||||
assert is_binary(encoded) and byte_size(encoded) > 0
|
||||
assert byte_size(encoded) > 0
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -155,13 +155,13 @@ defmodule Towerops.Agent.ProtoTest do
|
|||
}
|
||||
|
||||
encoded = SnmpDevice.encode(device)
|
||||
assert is_binary(encoded)
|
||||
assert is_binary(encoded) and byte_size(encoded) > 0
|
||||
end
|
||||
|
||||
test "encodes empty message" do
|
||||
device = %SnmpDevice{}
|
||||
encoded = SnmpDevice.encode(device)
|
||||
assert is_binary(encoded)
|
||||
assert is_binary(encoded) and byte_size(encoded) > 0
|
||||
end
|
||||
|
||||
test "round-trips through AgentJob" do
|
||||
|
|
@ -198,7 +198,7 @@ defmodule Towerops.Agent.ProtoTest do
|
|||
}
|
||||
|
||||
encoded = SnmpQuery.encode(query)
|
||||
assert is_binary(encoded)
|
||||
assert is_binary(encoded) and byte_size(encoded) > 0
|
||||
end
|
||||
|
||||
test "encodes WALK query" do
|
||||
|
|
@ -208,13 +208,13 @@ defmodule Towerops.Agent.ProtoTest do
|
|||
}
|
||||
|
||||
encoded = SnmpQuery.encode(query)
|
||||
assert is_binary(encoded)
|
||||
assert is_binary(encoded) and byte_size(encoded) > 0
|
||||
end
|
||||
|
||||
test "encodes empty message" do
|
||||
query = %SnmpQuery{}
|
||||
encoded = SnmpQuery.encode(query)
|
||||
assert is_binary(encoded)
|
||||
assert is_binary(encoded) and byte_size(encoded) > 0
|
||||
end
|
||||
|
||||
test "round-trips through AgentJob" do
|
||||
|
|
@ -342,13 +342,13 @@ defmodule Towerops.Agent.ProtoTest do
|
|||
}
|
||||
|
||||
encoded = AgentJobList.encode(job_list)
|
||||
assert is_binary(encoded)
|
||||
assert is_binary(encoded) and byte_size(encoded) > 0
|
||||
end
|
||||
|
||||
test "encodes empty job list" do
|
||||
job_list = %AgentJobList{jobs: []}
|
||||
encoded = AgentJobList.encode(job_list)
|
||||
assert is_binary(encoded)
|
||||
assert is_binary(encoded) and byte_size(encoded) > 0
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -455,7 +455,7 @@ defmodule Towerops.Agent.ProtoTest do
|
|||
}
|
||||
|
||||
encoded = NeighborDiscovery.encode(neighbor)
|
||||
assert is_binary(encoded)
|
||||
assert is_binary(encoded) and byte_size(encoded) > 0
|
||||
end
|
||||
|
||||
test "encodes CDP neighbor" do
|
||||
|
|
@ -470,13 +470,13 @@ defmodule Towerops.Agent.ProtoTest do
|
|||
}
|
||||
|
||||
encoded = NeighborDiscovery.encode(neighbor)
|
||||
assert is_binary(encoded)
|
||||
assert is_binary(encoded) and byte_size(encoded) > 0
|
||||
end
|
||||
|
||||
test "encodes empty message" do
|
||||
neighbor = %NeighborDiscovery{}
|
||||
encoded = NeighborDiscovery.encode(neighbor)
|
||||
assert is_binary(encoded)
|
||||
assert is_binary(encoded) and byte_size(encoded) > 0
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ defmodule Towerops.Recommendations.Rules.FrequencyChangeTest do
|
|||
|
||||
assert [insight] = FrequencyChange.evaluate(org.id)
|
||||
md = insight.metadata
|
||||
assert is_list(md["top_offenders"])
|
||||
assert is_list(md["top_offenders"]) and md["top_offenders"] != []
|
||||
refute Enum.empty?(md["top_offenders"])
|
||||
[first | _] = md["top_offenders"]
|
||||
assert first["bssid"] == "11:22:33:44:55:66"
|
||||
|
|
@ -132,7 +132,7 @@ defmodule Towerops.Recommendations.Rules.FrequencyChangeTest do
|
|||
insert_scan(org, device, %{bssid: "11:22:33:44:55:77", channel: 153, rssi_dbm: -90})
|
||||
|
||||
assert [insight] = FrequencyChange.evaluate(org.id)
|
||||
assert is_binary(insight.title)
|
||||
assert is_binary(insight.title) and byte_size(insight.title) > 0
|
||||
assert insight.title =~ "AP-North"
|
||||
assert insight.title =~ "149"
|
||||
end
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ defmodule Towerops.Recommendations.Rules.UpstreamDegradationTest do
|
|||
|
||||
[insight] = UpstreamDegradation.evaluate(org.id)
|
||||
aps = insight.metadata["degraded_aps"]
|
||||
assert is_list(aps)
|
||||
assert is_list(aps) and aps != []
|
||||
ids = Enum.map(aps, & &1["preseem_ap_id"])
|
||||
assert a.id in ids
|
||||
assert b.id in ids
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ defmodule Towerops.SettingsTest do
|
|||
|
||||
settings = Settings.list_all_settings()
|
||||
|
||||
assert is_list(settings)
|
||||
assert is_list(settings) and settings != []
|
||||
refute Enum.empty?(settings)
|
||||
assert Enum.any?(settings, &(&1.key == "test_setting"))
|
||||
end
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ defmodule Towerops.Snmp.AgentDiscoveryTest do
|
|||
AgentDiscovery.process_agent_discovery(device, oid_values)
|
||||
|
||||
assert discovered.device_id == device.id
|
||||
assert is_list(discovered.interfaces)
|
||||
assert is_list(discovered.interfaces) and discovered.interfaces != []
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ defmodule Towerops.Snmp.ClientTest do
|
|||
end)
|
||||
|
||||
assert {:ok, results} = Client.walk(@test_opts, "1.3.6.1.2.1.2.2.1.2")
|
||||
assert is_map(results)
|
||||
assert is_map(results) and map_size(results) > 0
|
||||
assert results["1.3.6.1.2.1.2.2.1.2.1"] == "eth0"
|
||||
assert results["1.3.6.1.2.1.2.2.1.2.2"] == "eth1"
|
||||
end
|
||||
|
|
@ -223,7 +223,7 @@ defmodule Towerops.Snmp.ClientTest do
|
|||
end)
|
||||
|
||||
assert {:ok, results} = Client.get_bulk(@test_opts, "1.3.6.1.2.1.2.2.1.10", max_repetitions: 10)
|
||||
assert is_map(results)
|
||||
assert is_map(results) and map_size(results) > 0
|
||||
assert results["1.3.6.1.2.1.2.2.1.10.1"] == 1000
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -198,7 +198,6 @@ defmodule Towerops.Snmp.Discovery.PrinterSupplySyncTest do
|
|||
assert :ok = Discovery.sync_printer_supplies(snmp_device, discovered_supplies)
|
||||
|
||||
updated_supply = Repo.get(PrinterSupply, original_supply.id)
|
||||
assert updated_supply
|
||||
assert updated_supply.supply_description == "Updated"
|
||||
# ID should not change
|
||||
assert updated_supply.id == original_supply.id
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ defmodule Towerops.Snmp.DiscoveryExtraTest do
|
|||
entries = Repo.all(Towerops.Snmp.ArpEntry)
|
||||
# save_arp_entries returns :ok regardless of whether the entry persisted;
|
||||
# the upsert path itself is what we want to exercise.
|
||||
assert is_list(entries)
|
||||
assert is_list(entries) and entries != []
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ defmodule Towerops.Snmp.MibParserTest do
|
|||
|
||||
oids = MibParser.parse_mib_content(content)
|
||||
|
||||
assert is_map(oids)
|
||||
assert is_map(oids) and map_size(oids) > 0
|
||||
# These won't resolve without parent "system" being defined as a root
|
||||
# but they should be extracted as assignments
|
||||
end
|
||||
|
|
@ -28,7 +28,7 @@ defmodule Towerops.Snmp.MibParserTest do
|
|||
|
||||
oids = MibParser.parse_mib_content(content)
|
||||
|
||||
assert is_map(oids)
|
||||
assert is_map(oids) and map_size(oids) > 0
|
||||
# enterprises should resolve to 1.3.6.1.4.1
|
||||
assert Map.get(oids, "enterprises") == "1.3.6.1.4.1"
|
||||
end
|
||||
|
|
@ -44,7 +44,7 @@ defmodule Towerops.Snmp.MibParserTest do
|
|||
oids = MibParser.parse_mib_content(content)
|
||||
|
||||
# Should parse without errors
|
||||
assert is_map(oids)
|
||||
assert is_map(oids) and map_size(oids) > 0
|
||||
end
|
||||
|
||||
test "resolves OIDs with known roots" do
|
||||
|
|
@ -85,7 +85,7 @@ defmodule Towerops.Snmp.MibParserTest do
|
|||
test "handles empty content" do
|
||||
oids = MibParser.parse_mib_content("")
|
||||
|
||||
assert is_map(oids)
|
||||
assert is_map(oids) and map_size(oids) > 0
|
||||
# Should have root OIDs
|
||||
assert map_size(oids) > 0
|
||||
end
|
||||
|
|
@ -103,7 +103,7 @@ defmodule Towerops.Snmp.MibParserTest do
|
|||
|
||||
oids = MibParser.parse_mib_content(content)
|
||||
|
||||
assert is_map(oids)
|
||||
assert is_map(oids) and map_size(oids) > 0
|
||||
end
|
||||
|
||||
test "extracts multiple objects from real-world MIB structure" do
|
||||
|
|
@ -156,7 +156,7 @@ defmodule Towerops.Snmp.MibParserTest do
|
|||
""")
|
||||
|
||||
assert {:ok, oids} = MibParser.parse_mib_file(mib_file)
|
||||
assert is_map(oids)
|
||||
assert is_map(oids) and map_size(oids) > 0
|
||||
assert Map.get(oids, "testObject") == "1.3.6.1.4.1.9999"
|
||||
assert Map.get(oids, "testChild") == "1.3.6.1.4.1.9999.1"
|
||||
end
|
||||
|
|
@ -242,7 +242,7 @@ defmodule Towerops.Snmp.MibParserTest do
|
|||
describe "list_mib_files/0" do
|
||||
test "returns a list" do
|
||||
files = MibParser.list_mib_files()
|
||||
assert is_list(files)
|
||||
assert is_list(files) and files != []
|
||||
end
|
||||
|
||||
test "returns absolute paths" do
|
||||
|
|
@ -289,7 +289,7 @@ defmodule Towerops.Snmp.MibParserTest do
|
|||
"""
|
||||
|
||||
oids = MibParser.parse_mib_content(content)
|
||||
assert is_map(oids)
|
||||
assert is_map(oids) and map_size(oids) > 0
|
||||
end
|
||||
|
||||
test "handles definitions with hyphens in names" do
|
||||
|
|
|
|||
|
|
@ -113,12 +113,11 @@ defmodule Towerops.Snmp.MibTranslatorTest do
|
|||
Application.put_env(:towerops, :mib_dirs, [Path.join(tmp_dir, "mibs")])
|
||||
|
||||
# Try translation (will fail but exercises expand_mib_directory)
|
||||
_result = MibTranslator.translate("TEST-MIB::testObject.0")
|
||||
assert {:error, :translation_failed} =
|
||||
MibTranslator.translate("TEST-MIB::testObject.0")
|
||||
|
||||
# Cleanup
|
||||
Application.delete_env(:towerops, :mib_dirs)
|
||||
|
||||
assert true
|
||||
end
|
||||
|
||||
test "handles nonexistent directory" do
|
||||
|
|
|
|||
|
|
@ -65,8 +65,7 @@ defmodule Towerops.Snmp.MibValidationTest do
|
|||
{"ifAlias", "1.3.6.1.2.1.31.1.1.1.18"}
|
||||
]
|
||||
|
||||
validate_oids(mib_file, validations)
|
||||
assert true
|
||||
assert :ok = validate_oids(mib_file, validations)
|
||||
end
|
||||
|
||||
test "sensor OIDs match ENTITY-SENSOR-MIB" do
|
||||
|
|
@ -79,8 +78,7 @@ defmodule Towerops.Snmp.MibValidationTest do
|
|||
{"entPhySensorOperStatus", "1.3.6.1.2.1.99.1.1.1.5"}
|
||||
]
|
||||
|
||||
validate_oids(mib_file, validations)
|
||||
assert true
|
||||
assert :ok = validate_oids(mib_file, validations)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -95,8 +93,7 @@ defmodule Towerops.Snmp.MibValidationTest do
|
|||
{"entSensorStatus", "1.3.6.1.4.1.9.9.91.1.1.1.1.5"}
|
||||
]
|
||||
|
||||
validate_oids(mib_file, validations)
|
||||
assert true
|
||||
assert :ok = validate_oids(mib_file, validations)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -113,8 +110,7 @@ defmodule Towerops.Snmp.MibValidationTest do
|
|||
{"lmVoltSensorsValue", "1.3.6.1.4.1.2021.13.16.4.1.3"}
|
||||
]
|
||||
|
||||
validate_oids(mib_file, validations)
|
||||
assert true
|
||||
assert :ok = validate_oids(mib_file, validations)
|
||||
end
|
||||
|
||||
test "UCD-SNMP OIDs match UCD-SNMP-MIB" do
|
||||
|
|
@ -134,8 +130,7 @@ defmodule Towerops.Snmp.MibValidationTest do
|
|||
{name, String.replace_suffix(oid, ".0", "")}
|
||||
end)
|
||||
|
||||
validate_oids(mib_file, validations)
|
||||
assert true
|
||||
assert :ok = validate_oids(mib_file, validations)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -151,7 +146,7 @@ defmodule Towerops.Snmp.MibValidationTest do
|
|||
if File.exists?(mib_file) do
|
||||
case MibParser.parse_mib_file(mib_file) do
|
||||
{:ok, oids} ->
|
||||
assert is_map(oids)
|
||||
assert is_map(oids) and map_size(oids) > 0
|
||||
assert map_size(oids) > 0
|
||||
|
||||
{:error, reason} ->
|
||||
|
|
@ -164,7 +159,7 @@ defmodule Towerops.Snmp.MibValidationTest do
|
|||
test "list_mib_files returns all MIB files" do
|
||||
mib_files = MibParser.list_mib_files()
|
||||
|
||||
assert is_list(mib_files)
|
||||
assert is_list(mib_files) and mib_files != []
|
||||
|
||||
# Should have at least the standard MIBs
|
||||
assert Enum.any?(mib_files, &String.contains?(&1, "IF-MIB"))
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ defmodule Towerops.Snmp.Profiles.BaseExtraTest do
|
|||
[cpu] = processors
|
||||
assert cpu.processor_type == "ucd_cpu"
|
||||
assert cpu.processor_index == "ucd_0"
|
||||
assert is_map(cpu.metadata)
|
||||
assert is_map(cpu.metadata) and map_size(cpu.metadata) > 0
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ defmodule Towerops.Snmp.Profiles.BasePrinterSupplyTest do
|
|||
assert length(supplies) == 2
|
||||
|
||||
black_toner = Enum.find(supplies, &(&1.supply_index == "1"))
|
||||
assert black_toner
|
||||
assert black_toner.supply_type == "toner"
|
||||
assert black_toner.supply_description == "Black Toner Cartridge"
|
||||
assert black_toner.supply_unit == "percent"
|
||||
|
|
@ -46,7 +45,6 @@ defmodule Towerops.Snmp.Profiles.BasePrinterSupplyTest do
|
|||
assert black_toner.color_name == "black"
|
||||
|
||||
cyan_toner = Enum.find(supplies, &(&1.supply_index == "2"))
|
||||
assert cyan_toner
|
||||
assert cyan_toner.supply_type == "toner"
|
||||
assert cyan_toner.current_level == 8500
|
||||
assert cyan_toner.color_name == "cyan"
|
||||
|
|
|
|||
|
|
@ -75,8 +75,8 @@ defmodule Towerops.Snmp.Profiles.DynamicExtraTest do
|
|||
|
||||
result = Dynamic.collect_vendor_debug_data(profile, @client_opts)
|
||||
|
||||
assert is_list(result.discovered_sensors)
|
||||
assert is_map(result.wireless_sensors)
|
||||
assert is_list(result.discovered_sensors) and result.discovered_sensors != []
|
||||
assert is_map(result.wireless_sensors) and map_size(result.wireless_sensors) > 0
|
||||
|
||||
# State sensor adds state_descr field to debug entry
|
||||
state_entry = Enum.find(result.discovered_sensors, fn s -> Map.has_key?(s, :state_descr) end)
|
||||
|
|
@ -96,7 +96,7 @@ defmodule Towerops.Snmp.Profiles.DynamicExtraTest do
|
|||
result = Dynamic.collect_vendor_debug_data(profile, @client_opts)
|
||||
|
||||
assert result.wireless_sensors == %{}
|
||||
assert is_list(result.discovered_sensors)
|
||||
assert is_list(result.discovered_sensors) and result.discovered_sensors != []
|
||||
end
|
||||
|
||||
test "handles profile without :name key in get_vendor_wireless_oids" do
|
||||
|
|
@ -178,7 +178,7 @@ defmodule Towerops.Snmp.Profiles.DynamicExtraTest do
|
|||
assert {:ok, sensors} = Dynamic.discover_sensors(profile, @client_opts)
|
||||
# No sensors discovered - post_process_sensors is called with empty list
|
||||
# and returns it unchanged.
|
||||
assert is_list(sensors)
|
||||
assert is_list(sensors) and sensors != []
|
||||
end
|
||||
|
||||
test "arista-mos profile delegates to Arista.post_process_sensors" do
|
||||
|
|
@ -192,7 +192,7 @@ defmodule Towerops.Snmp.Profiles.DynamicExtraTest do
|
|||
stub(SnmpMock, :walk, fn _, _, _ -> {:ok, []} end)
|
||||
|
||||
assert {:ok, sensors} = Dynamic.discover_sensors(profile, @client_opts)
|
||||
assert is_list(sensors)
|
||||
assert is_list(sensors) and sensors != []
|
||||
end
|
||||
|
||||
test "dell-powervault profile delegates to Powervault.post_process_sensors" do
|
||||
|
|
@ -206,7 +206,7 @@ defmodule Towerops.Snmp.Profiles.DynamicExtraTest do
|
|||
stub(SnmpMock, :walk, fn _, _, _ -> {:ok, []} end)
|
||||
|
||||
assert {:ok, sensors} = Dynamic.discover_sensors(profile, @client_opts)
|
||||
assert is_list(sensors)
|
||||
assert is_list(sensors) and sensors != []
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.A10Test do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = A10.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.A10Test do
|
|||
|
||||
sensors = A10.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AdtranTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Adtran.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -52,7 +51,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AdtranTest do
|
|||
defs = Adtran.wireless_oid_defs()
|
||||
cpu = Enum.find(defs, &(&1.sensor_descr == "CPU Utilization"))
|
||||
|
||||
assert cpu
|
||||
assert cpu.sensor_type == "load"
|
||||
assert cpu.sensor_unit == "%"
|
||||
end
|
||||
|
|
@ -61,7 +59,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AdtranTest do
|
|||
defs = Adtran.wireless_oid_defs()
|
||||
cpu_avg = Enum.find(defs, &(&1.sensor_descr == "CPU 5min Average"))
|
||||
|
||||
assert cpu_avg
|
||||
assert cpu_avg.sensor_type == "load"
|
||||
end
|
||||
end
|
||||
|
|
@ -80,7 +77,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AdtranTest do
|
|||
|
||||
sensors = Adtran.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == 4
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AdvaTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Adva.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -91,7 +90,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AdvaTest do
|
|||
|
||||
sensors = Adva.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AdvantechTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Advantech.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AdvantechTest do
|
|||
|
||||
sensors = Advantech.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AerohiveTest do
|
|||
test "returns list of wireless sensor definitions" do
|
||||
defs = Aerohive.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -52,7 +51,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AerohiveTest do
|
|||
defs = Aerohive.wireless_oid_defs()
|
||||
clients = Enum.find(defs, &(&1.sensor_descr == "Associated Clients"))
|
||||
|
||||
assert clients
|
||||
assert clients.sensor_type == "clients"
|
||||
end
|
||||
|
||||
|
|
@ -61,9 +59,7 @@ defmodule Towerops.Snmp.Profiles.Vendors.AerohiveTest do
|
|||
clients_2g = Enum.find(defs, &(&1.sensor_descr == "2.4GHz Clients"))
|
||||
clients_5g = Enum.find(defs, &(&1.sensor_descr == "5GHz Clients"))
|
||||
|
||||
assert clients_2g
|
||||
assert clients_2g.sensor_type == "clients"
|
||||
assert clients_5g
|
||||
assert clients_5g.sensor_type == "clients"
|
||||
end
|
||||
|
||||
|
|
@ -71,7 +67,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AerohiveTest do
|
|||
defs = Aerohive.wireless_oid_defs()
|
||||
cpu = Enum.find(defs, &(&1.sensor_descr == "CPU Utilization"))
|
||||
|
||||
assert cpu
|
||||
assert cpu.sensor_type == "load"
|
||||
assert cpu.sensor_unit == "%"
|
||||
end
|
||||
|
|
@ -80,7 +75,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AerohiveTest do
|
|||
defs = Aerohive.wireless_oid_defs()
|
||||
mem = Enum.find(defs, &(&1.sensor_descr == "Memory Utilization"))
|
||||
|
||||
assert mem
|
||||
assert mem.sensor_type == "load"
|
||||
assert mem.sensor_unit == "%"
|
||||
end
|
||||
|
|
@ -89,7 +83,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AerohiveTest do
|
|||
defs = Aerohive.wireless_oid_defs()
|
||||
temp = Enum.find(defs, &(&1.sensor_type == "temperature"))
|
||||
|
||||
assert temp
|
||||
assert temp.sensor_descr == "System Temperature"
|
||||
end
|
||||
end
|
||||
|
|
@ -110,7 +103,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AerohiveTest do
|
|||
|
||||
sensors = Aerohive.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == 6
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AirconsoleTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Airconsole.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AirconsoleTest do
|
|||
|
||||
sensors = Airconsole.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AirfiberTest do
|
|||
test "returns list of wireless sensor definitions" do
|
||||
defs = Airfiber.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -95,7 +94,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AirfiberTest do
|
|||
|
||||
sensors = Airfiber.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == 7
|
||||
|
||||
# Verify config table OIDs used for frequency
|
||||
|
|
@ -128,7 +126,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AirfiberTest do
|
|||
|
||||
sensors = Airfiber.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == 6
|
||||
|
||||
# Verify LTU OIDs were used
|
||||
|
|
@ -155,7 +152,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AirfiberTest do
|
|||
sensors = Airfiber.discover_wireless_sensors(@client_opts)
|
||||
|
||||
# Frequency sensor should still be discovered
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == 1
|
||||
assert List.first(sensors).sensor_type == "frequency"
|
||||
end
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AlcatelTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Alcatel.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AlcatelTest do
|
|||
|
||||
sensors = Alcatel.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AlliedTelesisTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = AlliedTelesis.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -76,7 +75,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AlliedTelesisTest do
|
|||
defs = AlliedTelesis.wireless_oid_defs()
|
||||
cpu = Enum.find(defs, &(&1.sensor_descr == "CPU 5min Average"))
|
||||
|
||||
assert cpu
|
||||
assert cpu.sensor_type == "load"
|
||||
assert cpu.sensor_unit == "%"
|
||||
end
|
||||
|
|
@ -85,7 +83,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AlliedTelesisTest do
|
|||
defs = AlliedTelesis.wireless_oid_defs()
|
||||
temp = Enum.find(defs, &(&1.sensor_descr == "Temperature"))
|
||||
|
||||
assert temp
|
||||
assert temp.sensor_type == "temperature"
|
||||
assert temp.sensor_unit == "°C"
|
||||
end
|
||||
|
|
@ -106,7 +103,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AlliedTelesisTest do
|
|||
|
||||
sensors = AlliedTelesis.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == 5
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AlliedTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Allied.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AlliedTest do
|
|||
|
||||
sensors = Allied.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AlphaTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Alpha.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AlphaTest do
|
|||
|
||||
sensors = Alpha.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AltalabsTest do
|
|||
test "returns list of wireless sensor definitions" do
|
||||
defs = Altalabs.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -40,7 +39,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AltalabsTest do
|
|||
defs = Altalabs.wireless_oid_defs()
|
||||
cpu = Enum.find(defs, &(&1.sensor_descr == "CPU Load (1m)"))
|
||||
|
||||
assert cpu
|
||||
assert cpu.sensor_type == "load"
|
||||
end
|
||||
|
||||
|
|
@ -49,8 +47,8 @@ defmodule Towerops.Snmp.Profiles.Vendors.AltalabsTest do
|
|||
mem_used = Enum.find(defs, &(&1.sensor_descr == "Memory Used"))
|
||||
mem_total = Enum.find(defs, &(&1.sensor_descr == "Total Memory"))
|
||||
|
||||
assert mem_used
|
||||
assert mem_total
|
||||
assert %{sensor_descr: "Memory Used"} = mem_used
|
||||
assert %{sensor_descr: "Total Memory"} = mem_total
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -67,7 +65,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AltalabsTest do
|
|||
|
||||
sensors = Altalabs.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == 3
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AlvarionTest do
|
|||
test "returns list of wireless sensor definitions" do
|
||||
defs = Alvarion.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -52,7 +51,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AlvarionTest do
|
|||
defs = Alvarion.wireless_oid_defs()
|
||||
rssi = Enum.find(defs, &(&1.sensor_descr == "RSSI"))
|
||||
|
||||
assert rssi
|
||||
assert rssi.sensor_type == "rssi"
|
||||
assert rssi.sensor_unit == "dBm"
|
||||
end
|
||||
|
|
@ -61,7 +59,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AlvarionTest do
|
|||
defs = Alvarion.wireless_oid_defs()
|
||||
snr = Enum.find(defs, &(&1.sensor_descr == "SNR"))
|
||||
|
||||
assert snr
|
||||
assert snr.sensor_type == "snr"
|
||||
assert snr.sensor_unit == "dB"
|
||||
end
|
||||
|
|
@ -70,7 +67,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AlvarionTest do
|
|||
defs = Alvarion.wireless_oid_defs()
|
||||
clients = Enum.find(defs, &(&1.sensor_descr == "Associated Subscribers"))
|
||||
|
||||
assert clients
|
||||
assert clients.sensor_type == "clients"
|
||||
end
|
||||
end
|
||||
|
|
@ -89,7 +85,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AlvarionTest do
|
|||
|
||||
sensors = Alvarion.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == 4
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.ApcTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Apc.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -52,7 +51,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.ApcTest do
|
|||
defs = Apc.wireless_oid_defs()
|
||||
battery = Enum.find(defs, &(&1.sensor_descr == "Battery Capacity"))
|
||||
|
||||
assert battery
|
||||
assert battery.sensor_type == "load"
|
||||
assert battery.sensor_unit == "%"
|
||||
end
|
||||
|
|
@ -61,7 +59,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.ApcTest do
|
|||
defs = Apc.wireless_oid_defs()
|
||||
voltage = Enum.find(defs, &(&1.sensor_descr == "Output Voltage"))
|
||||
|
||||
assert voltage
|
||||
assert voltage.sensor_type == "voltage"
|
||||
assert voltage.sensor_unit == "V"
|
||||
end
|
||||
|
|
@ -70,7 +67,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.ApcTest do
|
|||
defs = Apc.wireless_oid_defs()
|
||||
load = Enum.find(defs, &(&1.sensor_descr == "Output Load"))
|
||||
|
||||
assert load
|
||||
assert load.sensor_type == "load"
|
||||
assert load.sensor_unit == "%"
|
||||
end
|
||||
|
|
@ -95,7 +91,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.ApcTest do
|
|||
|
||||
sensors = Apc.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == 9
|
||||
|
||||
battery = Enum.find(sensors, &(&1.sensor_descr == "Battery Capacity"))
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.ArborTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Arbor.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.ArborTest do
|
|||
|
||||
sensors = Arbor.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AristaTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Arista.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -60,7 +59,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AristaTest do
|
|||
defs = Arista.wireless_oid_defs()
|
||||
cpu = Enum.find(defs, &(&1.sensor_descr == "CPU Load"))
|
||||
|
||||
assert cpu
|
||||
assert cpu.sensor_type == "load"
|
||||
assert cpu.sensor_unit == "%"
|
||||
end
|
||||
|
|
@ -80,7 +78,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AristaTest do
|
|||
|
||||
sensors = Arista.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == 4
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.ArrisTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Arris.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.ArrisTest do
|
|||
|
||||
sensors = Arris.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.ArubaTest do
|
|||
test "returns list of wireless sensor definitions" do
|
||||
defs = Aruba.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -52,7 +51,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.ArubaTest do
|
|||
defs = Aruba.wireless_oid_defs()
|
||||
clients = Enum.find(defs, &(&1.sensor_descr == "Associated Clients"))
|
||||
|
||||
assert clients
|
||||
assert clients.sensor_type == "clients"
|
||||
end
|
||||
|
||||
|
|
@ -60,7 +58,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.ArubaTest do
|
|||
defs = Aruba.wireless_oid_defs()
|
||||
aps = Enum.find(defs, &(&1.sensor_type == "ap-count"))
|
||||
|
||||
assert aps
|
||||
assert aps.sensor_descr == "Managed APs"
|
||||
end
|
||||
|
||||
|
|
@ -68,7 +65,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.ArubaTest do
|
|||
defs = Aruba.wireless_oid_defs()
|
||||
cpu = Enum.find(defs, &(&1.sensor_descr == "CPU Utilization"))
|
||||
|
||||
assert cpu
|
||||
assert cpu.sensor_unit == "%"
|
||||
end
|
||||
end
|
||||
|
|
@ -88,7 +84,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.ArubaTest do
|
|||
|
||||
sensors = Aruba.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == 5
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AsentriaTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Asentria.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AsentriaTest do
|
|||
|
||||
sensors = Asentria.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AudiocodesTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Audiocodes.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AudiocodesTest do
|
|||
|
||||
sensors = Audiocodes.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AvayaTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Avaya.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AvayaTest do
|
|||
|
||||
sensors = Avaya.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AviatTest do
|
|||
test "returns list of wireless sensor definitions" do
|
||||
defs = Aviat.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert length(defs) == 5
|
||||
end
|
||||
|
||||
|
|
@ -120,7 +119,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AviatTest do
|
|||
|
||||
sensors = Aviat.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == 5
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AxisTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Axis.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.AxisTest do
|
|||
|
||||
sensors = Axis.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.BaicellsTest do
|
|||
test "returns list of wireless sensor definitions" do
|
||||
defs = Baicells.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -55,7 +54,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.BaicellsTest do
|
|||
defs = Baicells.wireless_oid_defs()
|
||||
rsrp = Enum.find(defs, &(&1.sensor_descr == "RSRP"))
|
||||
|
||||
assert rsrp
|
||||
assert rsrp.sensor_type == "rssi"
|
||||
assert rsrp.sensor_unit == "dBm"
|
||||
end
|
||||
|
|
@ -64,7 +62,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.BaicellsTest do
|
|||
defs = Baicells.wireless_oid_defs()
|
||||
rsrq = Enum.find(defs, &(&1.sensor_descr == "RSRQ"))
|
||||
|
||||
assert rsrq
|
||||
assert rsrq.sensor_type == "quality"
|
||||
assert rsrq.sensor_unit == "dB"
|
||||
end
|
||||
|
|
@ -73,7 +70,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.BaicellsTest do
|
|||
defs = Baicells.wireless_oid_defs()
|
||||
sinr = Enum.find(defs, &(&1.sensor_descr == "SINR"))
|
||||
|
||||
assert sinr
|
||||
assert sinr.sensor_type == "snr"
|
||||
assert sinr.sensor_unit == "dB"
|
||||
end
|
||||
|
|
@ -82,7 +78,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.BaicellsTest do
|
|||
defs = Baicells.wireless_oid_defs()
|
||||
tx = Enum.find(defs, &(&1.sensor_descr == "Tx Power"))
|
||||
|
||||
assert tx
|
||||
assert tx.sensor_type == "power"
|
||||
end
|
||||
|
||||
|
|
@ -90,7 +85,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.BaicellsTest do
|
|||
defs = Baicells.wireless_oid_defs()
|
||||
temp = Enum.find(defs, &(&1.sensor_type == "temperature"))
|
||||
|
||||
assert temp
|
||||
assert temp.sensor_descr == "Device Temperature"
|
||||
end
|
||||
end
|
||||
|
|
@ -111,7 +105,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.BaicellsTest do
|
|||
|
||||
sensors = Baicells.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == 6
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.BarcoTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Barco.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.BarcoTest do
|
|||
|
||||
sensors = Barco.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.BarracudaTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Barracuda.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -88,7 +87,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.BarracudaTest do
|
|||
|
||||
sensors = Barracuda.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.BistreamTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Bistream.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.BistreamTest do
|
|||
|
||||
sensors = Bistream.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.BkeTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Bke.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.BkeTest do
|
|||
|
||||
sensors = Bke.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.BrocadeTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Brocade.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.BrocadeTest do
|
|||
|
||||
sensors = Brocade.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.BtiTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Bti.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.BtiTest do
|
|||
|
||||
sensors = Bti.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CalixTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Calix.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -76,7 +75,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CalixTest do
|
|||
defs = Calix.wireless_oid_defs()
|
||||
cpu = Enum.find(defs, &(&1.sensor_descr == "CPU Load"))
|
||||
|
||||
assert cpu
|
||||
assert cpu.sensor_type == "load"
|
||||
end
|
||||
end
|
||||
|
|
@ -93,7 +91,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CalixTest do
|
|||
|
||||
sensors = Calix.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == 2
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CambiumPtpTest do
|
|||
test "returns list of wireless sensor definitions" do
|
||||
defs = CambiumPtp.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert length(defs) == 6
|
||||
end
|
||||
|
||||
|
|
@ -136,7 +135,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CambiumPtpTest do
|
|||
|
||||
sensors = CambiumPtp.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == 6
|
||||
|
||||
rx = Enum.find(sensors, &(&1.sensor_type == "rssi"))
|
||||
|
|
|
|||
|
|
@ -68,7 +68,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CambiumTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Cambium.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -105,7 +104,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CambiumTest do
|
|||
|
||||
sensors = Cambium.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
end
|
||||
|
|
@ -151,28 +149,24 @@ defmodule Towerops.Snmp.Profiles.Vendors.CambiumTest do
|
|||
|
||||
# Check RSSI sensor
|
||||
rssi_sensor = Enum.find(sensors, &(&1.sensor_type == "rssi"))
|
||||
assert rssi_sensor
|
||||
assert rssi_sensor.sensor_descr == "Downlink RSSI"
|
||||
assert rssi_sensor.last_value == -65
|
||||
assert rssi_sensor.sensor_unit == "dBm"
|
||||
|
||||
# Check SNR sensor
|
||||
snr_sensor = Enum.find(sensors, &(&1.sensor_type == "snr"))
|
||||
assert snr_sensor
|
||||
assert snr_sensor.sensor_descr == "Downlink SNR"
|
||||
assert snr_sensor.last_value == 25
|
||||
assert snr_sensor.sensor_unit == "dB"
|
||||
|
||||
# Check Frequency sensor
|
||||
freq_sensor = Enum.find(sensors, &(&1.sensor_type == "frequency"))
|
||||
assert freq_sensor
|
||||
assert freq_sensor.sensor_descr == "RF Frequency"
|
||||
assert freq_sensor.last_value == 5180
|
||||
assert freq_sensor.sensor_unit == "MHz"
|
||||
|
||||
# Check Clients sensor (AP mode only)
|
||||
clients_sensor = Enum.find(sensors, &(&1.sensor_type == "clients"))
|
||||
assert clients_sensor
|
||||
assert clients_sensor.sensor_descr == "Connected Subscribers"
|
||||
assert clients_sensor.last_value == 12
|
||||
end
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CdataTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Cdata.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CdataTest do
|
|||
|
||||
sensors = Cdata.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CeragonTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Ceragon.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert length(defs) == 2
|
||||
end
|
||||
|
||||
|
|
@ -89,7 +88,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CeragonTest do
|
|||
|
||||
sensors = Ceragon.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == 2
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.ChristieTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Christie.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.ChristieTest do
|
|||
|
||||
sensors = Christie.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CienaTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Ciena.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CienaTest do
|
|||
|
||||
sensors = Ciena.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CirpackTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Cirpack.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CirpackTest do
|
|||
|
||||
sensors = Cirpack.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -83,7 +83,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CiscoTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Cisco.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -111,7 +110,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CiscoTest do
|
|||
|
||||
sensors = Cisco.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CiscowapTest do
|
|||
test "returns list of wireless sensor definitions" do
|
||||
defs = Ciscowap.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -52,7 +51,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CiscowapTest do
|
|||
defs = Ciscowap.wireless_oid_defs()
|
||||
clients = Enum.find(defs, &(&1.sensor_descr == "Associated Clients"))
|
||||
|
||||
assert clients
|
||||
assert clients.sensor_type == "clients"
|
||||
end
|
||||
|
||||
|
|
@ -61,10 +59,8 @@ defmodule Towerops.Snmp.Profiles.Vendors.CiscowapTest do
|
|||
util_2g = Enum.find(defs, &(&1.sensor_descr == "2.4GHz Channel Utilization"))
|
||||
util_5g = Enum.find(defs, &(&1.sensor_descr == "5GHz Channel Utilization"))
|
||||
|
||||
assert util_2g
|
||||
assert util_2g.sensor_type == "load"
|
||||
assert util_2g.sensor_unit == "%"
|
||||
assert util_5g
|
||||
assert util_5g.sensor_type == "load"
|
||||
end
|
||||
|
||||
|
|
@ -73,10 +69,8 @@ defmodule Towerops.Snmp.Profiles.Vendors.CiscowapTest do
|
|||
noise_2g = Enum.find(defs, &(&1.sensor_descr == "2.4GHz Noise Floor"))
|
||||
noise_5g = Enum.find(defs, &(&1.sensor_descr == "5GHz Noise Floor"))
|
||||
|
||||
assert noise_2g
|
||||
assert noise_2g.sensor_type == "noise"
|
||||
assert noise_2g.sensor_unit == "dBm"
|
||||
assert noise_5g
|
||||
assert noise_5g.sensor_type == "noise"
|
||||
end
|
||||
end
|
||||
|
|
@ -96,7 +90,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CiscowapTest do
|
|||
|
||||
sensors = Ciscowap.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == 5
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CiscowlcTest do
|
|||
test "returns list of wireless sensor definitions" do
|
||||
defs = Ciscowlc.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -52,7 +51,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CiscowlcTest do
|
|||
defs = Ciscowlc.wireless_oid_defs()
|
||||
clients = Enum.find(defs, &(&1.sensor_descr == "Associated Clients"))
|
||||
|
||||
assert clients
|
||||
assert clients.sensor_type == "clients"
|
||||
end
|
||||
|
||||
|
|
@ -60,7 +58,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CiscowlcTest do
|
|||
defs = Ciscowlc.wireless_oid_defs()
|
||||
aps = Enum.find(defs, &(&1.sensor_descr == "Total APs"))
|
||||
|
||||
assert aps
|
||||
assert aps.sensor_type == "ap-count"
|
||||
end
|
||||
|
||||
|
|
@ -68,7 +65,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CiscowlcTest do
|
|||
defs = Ciscowlc.wireless_oid_defs()
|
||||
clients_5g = Enum.find(defs, &(&1.sensor_descr == "5GHz Clients"))
|
||||
|
||||
assert clients_5g
|
||||
assert clients_5g.sensor_type == "clients"
|
||||
end
|
||||
|
||||
|
|
@ -76,7 +72,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CiscowlcTest do
|
|||
defs = Ciscowlc.wireless_oid_defs()
|
||||
rogue = Enum.find(defs, &(&1.sensor_descr == "Rogue APs"))
|
||||
|
||||
assert rogue
|
||||
assert rogue.sensor_type == "count"
|
||||
end
|
||||
end
|
||||
|
|
@ -97,7 +92,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CiscowlcTest do
|
|||
|
||||
sensors = Ciscowlc.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == 6
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CitrixTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Citrix.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CitrixTest do
|
|||
|
||||
sensors = Citrix.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CmmTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Cmm.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -53,9 +52,7 @@ defmodule Towerops.Snmp.Profiles.Vendors.CmmTest do
|
|||
power = Enum.find(defs, &(&1.sensor_descr == "Power Status"))
|
||||
gps = Enum.find(defs, &(&1.sensor_descr == "GPS Sync Status"))
|
||||
|
||||
assert power
|
||||
assert power.sensor_type == "state"
|
||||
assert gps
|
||||
assert gps.sensor_type == "state"
|
||||
end
|
||||
|
||||
|
|
@ -63,7 +60,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CmmTest do
|
|||
defs = Cmm.wireless_oid_defs()
|
||||
aps = Enum.find(defs, &(&1.sensor_descr == "Connected APs"))
|
||||
|
||||
assert aps
|
||||
assert aps.sensor_type == "ap-count"
|
||||
end
|
||||
end
|
||||
|
|
@ -82,7 +78,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CmmTest do
|
|||
|
||||
sensors = Cmm.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == 4
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CnmatrixTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Cnmatrix.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -52,7 +51,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CnmatrixTest do
|
|||
defs = Cnmatrix.wireless_oid_defs()
|
||||
cpu = Enum.find(defs, &(&1.sensor_descr == "CPU Utilization"))
|
||||
|
||||
assert cpu
|
||||
assert cpu.sensor_type == "load"
|
||||
assert cpu.sensor_unit == "%"
|
||||
end
|
||||
|
|
@ -61,7 +59,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CnmatrixTest do
|
|||
defs = Cnmatrix.wireless_oid_defs()
|
||||
temp = Enum.find(defs, &(&1.sensor_type == "temperature"))
|
||||
|
||||
assert temp
|
||||
assert temp.sensor_descr == "System Temperature"
|
||||
end
|
||||
|
||||
|
|
@ -69,7 +66,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CnmatrixTest do
|
|||
defs = Cnmatrix.wireless_oid_defs()
|
||||
poe = Enum.find(defs, &(&1.sensor_descr == "Total PoE Power"))
|
||||
|
||||
assert poe
|
||||
assert poe.sensor_type == "power"
|
||||
end
|
||||
end
|
||||
|
|
@ -89,7 +85,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CnmatrixTest do
|
|||
|
||||
sensors = Cnmatrix.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == 5
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CnpilotTest do
|
|||
test "returns list of wireless sensor definitions" do
|
||||
defs = Cnpilot.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -40,7 +39,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CnpilotTest do
|
|||
defs = Cnpilot.wireless_oid_defs()
|
||||
clients = Enum.find(defs, &(&1.sensor_type == "clients"))
|
||||
|
||||
assert clients
|
||||
assert clients.sensor_descr == "Clients"
|
||||
end
|
||||
|
||||
|
|
@ -48,7 +46,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CnpilotTest do
|
|||
defs = Cnpilot.wireless_oid_defs()
|
||||
snr = Enum.find(defs, &(&1.sensor_type == "snr"))
|
||||
|
||||
assert snr
|
||||
assert snr.sensor_unit == "dB"
|
||||
end
|
||||
|
||||
|
|
@ -56,7 +53,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CnpilotTest do
|
|||
defs = Cnpilot.wireless_oid_defs()
|
||||
power = Enum.find(defs, &(&1.sensor_type == "power"))
|
||||
|
||||
assert power
|
||||
assert power.sensor_descr == "Transmit Power"
|
||||
assert power.sensor_unit == "dBm"
|
||||
end
|
||||
|
|
@ -65,7 +61,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CnpilotTest do
|
|||
defs = Cnpilot.wireless_oid_defs()
|
||||
noise = Enum.find(defs, &(&1.sensor_type == "noise-floor"))
|
||||
|
||||
assert noise
|
||||
assert noise.sensor_descr == "Radio Noise Floor"
|
||||
assert noise.sensor_unit == "dBm"
|
||||
end
|
||||
|
|
@ -85,17 +80,14 @@ defmodule Towerops.Snmp.Profiles.Vendors.CnpilotTest do
|
|||
|
||||
sensors = Cnpilot.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == 4
|
||||
|
||||
# Check clients sensor
|
||||
clients = Enum.find(sensors, &(&1.sensor_descr == "Clients"))
|
||||
assert clients
|
||||
assert clients.last_value == 25.0
|
||||
|
||||
# Check noise floor sensor
|
||||
noise = Enum.find(sensors, &(&1.sensor_descr == "Radio Noise Floor"))
|
||||
assert noise
|
||||
assert noise.last_value == -95.0
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.Cnwave60Test do
|
|||
test "returns list of wireless sensor definitions" do
|
||||
defs = Cnwave60.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -52,7 +51,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.Cnwave60Test do
|
|||
defs = Cnwave60.wireless_oid_defs()
|
||||
rsl = Enum.find(defs, &(&1.sensor_descr == "Receive Signal Level"))
|
||||
|
||||
assert rsl
|
||||
assert rsl.sensor_type == "rssi"
|
||||
assert rsl.sensor_divisor == 10
|
||||
end
|
||||
|
|
@ -61,7 +59,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.Cnwave60Test do
|
|||
defs = Cnwave60.wireless_oid_defs()
|
||||
snr = Enum.find(defs, &(&1.sensor_descr == "Signal to Noise Ratio"))
|
||||
|
||||
assert snr
|
||||
assert snr.sensor_type == "snr"
|
||||
end
|
||||
|
||||
|
|
@ -69,7 +66,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.Cnwave60Test do
|
|||
defs = Cnwave60.wireless_oid_defs()
|
||||
temp = Enum.find(defs, &(&1.sensor_type == "temperature"))
|
||||
|
||||
assert temp
|
||||
assert temp.sensor_descr == "System Temperature"
|
||||
end
|
||||
end
|
||||
|
|
@ -89,7 +85,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.Cnwave60Test do
|
|||
|
||||
sensors = Cnwave60.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == 5
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CoreroTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Corero.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CoreroTest do
|
|||
|
||||
sensors = Corero.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CtsTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Cts.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CtsTest do
|
|||
|
||||
sensors = Cts.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CyberpowerTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Cyberpower.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.CyberpowerTest do
|
|||
|
||||
sensors = Cyberpower.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.DahuaTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Dahua.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.DahuaTest do
|
|||
|
||||
sensors = Dahua.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.DanthermTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Dantherm.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.DanthermTest do
|
|||
|
||||
sensors = Dantherm.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.DeliberantTest do
|
|||
test "returns list of wireless sensor definitions" do
|
||||
defs = Deliberant.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -52,7 +51,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.DeliberantTest do
|
|||
defs = Deliberant.wireless_oid_defs()
|
||||
signal = Enum.find(defs, &(&1.sensor_descr == "Signal Level"))
|
||||
|
||||
assert signal
|
||||
assert signal.sensor_type == "rssi"
|
||||
assert signal.sensor_unit == "dBm"
|
||||
end
|
||||
|
|
@ -61,7 +59,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.DeliberantTest do
|
|||
defs = Deliberant.wireless_oid_defs()
|
||||
noise = Enum.find(defs, &(&1.sensor_descr == "Noise Floor"))
|
||||
|
||||
assert noise
|
||||
assert noise.sensor_type == "noise"
|
||||
end
|
||||
|
||||
|
|
@ -69,7 +66,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.DeliberantTest do
|
|||
defs = Deliberant.wireless_oid_defs()
|
||||
temp = Enum.find(defs, &(&1.sensor_type == "temperature"))
|
||||
|
||||
assert temp
|
||||
assert temp.sensor_descr == "CPU Temperature"
|
||||
end
|
||||
end
|
||||
|
|
@ -89,7 +85,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.DeliberantTest do
|
|||
|
||||
sensors = Deliberant.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == 5
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.DellTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Dell.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -92,7 +91,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.DellTest do
|
|||
|
||||
sensors = Dell.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.DeltaTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Delta.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.DeltaTest do
|
|||
|
||||
sensors = Delta.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.DeltanetTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Deltanet.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.DeltanetTest do
|
|||
|
||||
sensors = Deltanet.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.DevaTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Deva.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.DevaTest do
|
|||
|
||||
sensors = Deva.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.DktTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Dkt.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.DktTest do
|
|||
|
||||
sensors = Dkt.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.DlinkTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Dlink.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.DlinkTest do
|
|||
|
||||
sensors = Dlink.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.DlinkapTest do
|
|||
test "returns list of wireless sensor definitions" do
|
||||
defs = Dlinkap.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -52,7 +51,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.DlinkapTest do
|
|||
defs = Dlinkap.wireless_oid_defs()
|
||||
clients = Enum.find(defs, &(&1.sensor_descr == "Associated Clients"))
|
||||
|
||||
assert clients
|
||||
assert clients.sensor_type == "clients"
|
||||
end
|
||||
|
||||
|
|
@ -60,7 +58,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.DlinkapTest do
|
|||
defs = Dlinkap.wireless_oid_defs()
|
||||
cpu = Enum.find(defs, &(&1.sensor_descr == "CPU Utilization"))
|
||||
|
||||
assert cpu
|
||||
assert cpu.sensor_type == "load"
|
||||
end
|
||||
|
||||
|
|
@ -69,8 +66,8 @@ defmodule Towerops.Snmp.Profiles.Vendors.DlinkapTest do
|
|||
clients_2g = Enum.find(defs, &(&1.sensor_descr == "2.4GHz Clients"))
|
||||
clients_5g = Enum.find(defs, &(&1.sensor_descr == "5GHz Clients"))
|
||||
|
||||
assert clients_2g
|
||||
assert clients_5g
|
||||
assert %{sensor_descr: "2.4GHz Clients"} = clients_2g
|
||||
assert %{sensor_descr: "5GHz Clients"} = clients_5g
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -88,7 +85,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.DlinkapTest do
|
|||
|
||||
sensors = Dlinkap.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == 4
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.DpstelecomTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Dpstelecom.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.DpstelecomTest do
|
|||
|
||||
sensors = Dpstelecom.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.DragonwaveTest do
|
|||
test "returns list of wireless sensor definitions" do
|
||||
defs = Dragonwave.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert length(defs) == 3
|
||||
end
|
||||
|
||||
|
|
@ -104,7 +103,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.DragonwaveTest do
|
|||
|
||||
sensors = Dragonwave.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == 3
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.EatonTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Eaton.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.EatonTest do
|
|||
|
||||
sensors = Eaton.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.EdfaTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Edfa.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.EdfaTest do
|
|||
|
||||
sensors = Edfa.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.EdgeswitchTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Edgeswitch.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert length(defs) == 2
|
||||
end
|
||||
|
||||
|
|
@ -68,7 +67,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.EdgeswitchTest do
|
|||
defs = Edgeswitch.wireless_oid_defs()
|
||||
temp = Enum.find(defs, &(&1.sensor_type == "temperature"))
|
||||
|
||||
assert temp
|
||||
assert temp.sensor_descr == "Temperature"
|
||||
assert temp.sensor_unit == "C"
|
||||
end
|
||||
|
|
@ -77,7 +75,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.EdgeswitchTest do
|
|||
defs = Edgeswitch.wireless_oid_defs()
|
||||
fan = Enum.find(defs, &(&1.sensor_type == "fanspeed"))
|
||||
|
||||
assert fan
|
||||
assert fan.sensor_descr == "Fan"
|
||||
assert fan.sensor_unit == "RPM"
|
||||
end
|
||||
|
|
@ -199,15 +196,12 @@ defmodule Towerops.Snmp.Profiles.Vendors.EdgeswitchTest do
|
|||
assert length(state_sensors) == 3
|
||||
|
||||
chassis = Enum.find(state_sensors, &(&1.sensor_descr == "Chassis state"))
|
||||
assert chassis
|
||||
assert chassis.last_value == 1
|
||||
|
||||
temp_state = Enum.find(state_sensors, &(&1.sensor_descr == "Temp Sensor 1"))
|
||||
assert temp_state
|
||||
assert temp_state.last_value == 1
|
||||
|
||||
fan_state = Enum.find(state_sensors, &(&1.sensor_descr == "Fan 1"))
|
||||
assert fan_state
|
||||
assert fan_state.last_value == 2
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.EdsTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Eds.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.EdsTest do
|
|||
|
||||
sensors = Eds.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.EkinopsTest do
|
|||
test "returns list of sensor definitions" do
|
||||
defs = Ekinops.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.EkinopsTest do
|
|||
|
||||
sensors = Ekinops.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == num_defs
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.EngeniusTest do
|
|||
test "returns list of wireless sensor definitions" do
|
||||
defs = Engenius.wireless_oid_defs()
|
||||
|
||||
assert is_list(defs)
|
||||
assert [_ | _] = defs
|
||||
end
|
||||
|
||||
|
|
@ -52,7 +51,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.EngeniusTest do
|
|||
defs = Engenius.wireless_oid_defs()
|
||||
clients = Enum.find(defs, &(&1.sensor_descr == "Connected Clients"))
|
||||
|
||||
assert clients
|
||||
assert clients.sensor_type == "clients"
|
||||
end
|
||||
|
||||
|
|
@ -61,8 +59,8 @@ defmodule Towerops.Snmp.Profiles.Vendors.EngeniusTest do
|
|||
clients_2g = Enum.find(defs, &(&1.sensor_descr == "2.4GHz Clients"))
|
||||
clients_5g = Enum.find(defs, &(&1.sensor_descr == "5GHz Clients"))
|
||||
|
||||
assert clients_2g
|
||||
assert clients_5g
|
||||
assert %{sensor_descr: "2.4GHz Clients"} = clients_2g
|
||||
assert %{sensor_descr: "5GHz Clients"} = clients_5g
|
||||
end
|
||||
|
||||
test "includes channel utilization sensors" do
|
||||
|
|
@ -70,9 +68,8 @@ defmodule Towerops.Snmp.Profiles.Vendors.EngeniusTest do
|
|||
util_2g = Enum.find(defs, &(&1.sensor_descr == "2.4GHz Channel Utilization"))
|
||||
util_5g = Enum.find(defs, &(&1.sensor_descr == "5GHz Channel Utilization"))
|
||||
|
||||
assert util_2g
|
||||
assert util_2g.sensor_type == "load"
|
||||
assert util_5g
|
||||
assert %{sensor_descr: "5GHz Channel Utilization"} = util_5g
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -93,7 +90,6 @@ defmodule Towerops.Snmp.Profiles.Vendors.EngeniusTest do
|
|||
|
||||
sensors = Engenius.discover_wireless_sensors(@client_opts)
|
||||
|
||||
assert is_list(sensors)
|
||||
assert length(sensors) == 7
|
||||
end
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue