• Class rename: MobilePreTest → MobileTests
• New method added: RunFinalTestAsync() - Performs final mobile tests including SSH verification of setup files • Calls SSH.MobiletxtCheck() to verify /home/mav/Mobile-Setup-configuration-marker.txt exists on device • Updates UI with "MobileSetup.sh" pass/fail status • Mobile Tests/Mobile API.cs (New File Created) New Method Added: MobiletxtCheck(string IPAddress) - Boolean method to verify setup marker file • Checks if /home/mav/Mobile-Setup-configuration-marker.txt exists on device via SSH • Returns exit status 0 (true) if file exists, false otherwise • Used in RunFinalTestAsync() for setup verification
This commit is contained in:
11
AiQ_GUI.cs
11
AiQ_GUI.cs
@@ -201,7 +201,7 @@ namespace AiQ_GUI
|
|||||||
}
|
}
|
||||||
else if (CbBxCamType.Text == "Mobile")
|
else if (CbBxCamType.Text == "Mobile")
|
||||||
{
|
{
|
||||||
await PreTestPassed();
|
await MobileTests.RunFinalTestAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,7 +218,7 @@ namespace AiQ_GUI
|
|||||||
}
|
}
|
||||||
else if (CbBxCamType.Text == "Mobile")
|
else if (CbBxCamType.Text == "Mobile")
|
||||||
{
|
{
|
||||||
await MobilePreTest.RunPreTestAsync();
|
await MobileTests.RunPreTestAsync();
|
||||||
await PreTestPassed();
|
await PreTestPassed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1452,13 +1452,14 @@ namespace AiQ_GUI
|
|||||||
|
|
||||||
//StatsExcel excelExporter = new();
|
//StatsExcel excelExporter = new();
|
||||||
//excelExporter.ExportDatabaseToExcel();
|
//excelExporter.ExportDatabaseToExcel();
|
||||||
//await MobilePreTest.CheckFirmwareAsync();
|
//await MobileTests.CheckFirmwareAsync();
|
||||||
FlexiAPI.GetVersions(CamOnTest.IP).Wait();
|
//FlexiAPI.GetVersions(CamOnTest.IP).Wait();
|
||||||
//VLC.Play(VidView);
|
//VLC.Play(VidView);
|
||||||
//await Task.Delay(5000);
|
//await Task.Delay(5000);
|
||||||
//VLC.TakeSnapshot(VidView);
|
//VLC.TakeSnapshot(VidView);
|
||||||
|
SSH.MobiletxtCheck("100.118.196.113");
|
||||||
|
|
||||||
// await MobileAPI.SetDayModeAsync();
|
// await MobileAPI.SetDayModeAsync();
|
||||||
|
|
||||||
AddToActionsList("RunTime " + stopWatchTest.Elapsed.ToString(@"hh\:mm\:ss\.ff"), Level.LOG);
|
AddToActionsList("RunTime " + stopWatchTest.Elapsed.ToString(@"hh\:mm\:ss\.ff"), Level.LOG);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace AiQ_GUI
|
|||||||
public const string SSHPassword = "mavPA$$";
|
public const string SSHPassword = "mavPA$$";
|
||||||
public const string SSHPasswordNEW = "#!mavsoftMESA19"; // New password for SSH after last one got leaked
|
public const string SSHPasswordNEW = "#!mavsoftMESA19"; // New password for SSH after last one got leaked
|
||||||
|
|
||||||
private static SshClient SshConnect(string IPAddress)
|
public static SshClient SshConnect(string IPAddress)
|
||||||
{
|
{
|
||||||
SshClient client = new(IPAddress, SSHUsername, SSHPasswordNEW);
|
SshClient client = new(IPAddress, SSHUsername, SSHPasswordNEW);
|
||||||
try
|
try
|
||||||
@@ -378,6 +378,24 @@ namespace AiQ_GUI
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public static bool MobiletxtCheck(string IPAddress)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (SshClient client = SshConnect(IPAddress))
|
||||||
|
{
|
||||||
|
// test -f returns exit status 0 if file exists
|
||||||
|
SshCommand checkDevice = client.RunCommand("test -f /home/mav/Mobile-Setup-configuration-marker.txt"
|
||||||
|
);
|
||||||
|
return checkDevice.ExitStatus == 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MainForm.Instance.AddToActionsList($"Can't check txt file: Error {ex}", Level.ERROR);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void Sync(string IPAddress)
|
public static void Sync(string IPAddress)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace AiQ_GUI.Mobile_Tests
|
namespace AiQ_GUI.Mobile_Tests
|
||||||
{
|
{
|
||||||
public static class MobilePreTest
|
public static class MobileTests
|
||||||
{
|
{
|
||||||
public static async Task RunPreTestAsync()
|
public static async Task RunPreTestAsync()
|
||||||
{
|
{
|
||||||
@@ -48,7 +48,17 @@ namespace AiQ_GUI.Mobile_Tests
|
|||||||
public static async Task RunFinalTestAsync()
|
public static async Task RunFinalTestAsync()
|
||||||
{
|
{
|
||||||
// Placeholder for any final tests if needed in the future
|
// Placeholder for any final tests if needed in the future
|
||||||
|
//RunPreTestAsync().Wait();
|
||||||
|
//SSH.MobiletxtCheck(MainForm.Instance.CamOnTest.IP);// Verify mobile.txt presence
|
||||||
|
if (SSH.MobiletxtCheck(MainForm.Instance.CamOnTest.IP) == true)
|
||||||
|
{
|
||||||
|
MainForm.Instance.AddLabelToPanel("MobileSetup.sh = True", false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MainForm.Instance.AddToActionsList("MobileSetup.sh test failed: mobile.txt not found on device.", Level.ERROR);
|
||||||
|
MainForm.Instance.AddLabelToPanel("MobileSetup.sh = False", true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async Task TestDayNightMode()
|
private static async Task TestDayNightMode()
|
||||||
|
|||||||
Reference in New Issue
Block a user