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