i can see it
This commit is contained in:
@@ -9,7 +9,8 @@ param(
|
|||||||
[string]$password,
|
[string]$password,
|
||||||
[switch]$Verbose,
|
[switch]$Verbose,
|
||||||
[string]$RemoteTestPath = "/root/.bin/test",
|
[string]$RemoteTestPath = "/root/.bin/test",
|
||||||
[string]$RemoteHost = "[email protected]"
|
[string]$RemoteHost = "[email protected]",
|
||||||
|
[switch]$Ignored
|
||||||
)
|
)
|
||||||
|
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
@@ -54,10 +55,11 @@ foreach ($testBinary in $testBinaries) {
|
|||||||
Invoke-Scp -Local $testBinary.FullName -Dest "${RemoteHost}:$RemoteTestPath" -Pass $password -Quiet
|
Invoke-Scp -Local $testBinary.FullName -Dest "${RemoteHost}:$RemoteTestPath" -Pass $password -Quiet
|
||||||
|
|
||||||
# Run on target
|
# Run on target
|
||||||
$testArgs = "$(if ($Verbose) {"--nocapture --show-output"})"
|
$parts = @()
|
||||||
if ($TestName) {
|
if ($TestName) { $parts += $TestName }
|
||||||
$testArgs = "$TestName $testArgs"
|
if ($Ignored) { $parts += "--ignored" }
|
||||||
}
|
if ($Verbose) { $parts += "--nocapture"; $parts += "--show-output" }
|
||||||
|
$testArgs = $parts -join " "
|
||||||
|
|
||||||
Invoke-Ssh -Cmd "chmod +x $RemoteTestPath && $RemoteTestPath $testArgs" -Remote $RemoteHost -Pass $password
|
Invoke-Ssh -Cmd "chmod +x $RemoteTestPath && $RemoteTestPath $testArgs" -Remote $RemoteHost -Pass $password
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
use wakey::inventory;
|
||||||
|
use wakey_core::DeviceQuery;
|
||||||
|
|
||||||
|
#[tokio::test]
|
||||||
|
#[ignore = "runs against live router data; use on-device or via scripts/test_remote.ps1"]
|
||||||
|
async fn inventory_real_router_prints_device_inventory() -> anyhow::Result<()> {
|
||||||
|
let inventory = inventory(DeviceQuery::default()).await?;
|
||||||
|
println!("{}", serde_json::to_string_pretty(&inventory)?);
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user