Skip to content

Commit

Permalink
Update IptcInterfaceTest.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
splitice committed Jan 1, 2024
1 parent 7adf541 commit f5462ee
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions IPTables.Net.Tests/IptcInterfaceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@ public void TestStartup()
Assert.Ignore();
}

Console.WriteLine("Test Startup");

var binary = GetBinary();
Process.Start(binary, "-F test").WaitForExit();
Execute(binary, "-F test");

Process.Start(binary, "-N test2").WaitForExit();
Execute(binary, "-N test2")

Check failure on line 65 in IPTables.Net.Tests/IptcInterfaceTest.cs

View workflow job for this annotation

GitHub Actions / build-ubuntu-latest

; expected

Check failure on line 65 in IPTables.Net.Tests/IptcInterfaceTest.cs

View workflow job for this annotation

GitHub Actions / build-ubuntu-latest

; expected
Process.Start(binary, "-N test").WaitForExit();
Process.Start(binary, "-A test -j ACCEPT").WaitForExit();

Expand All @@ -70,6 +71,14 @@ public void TestStartup()
}
}

private void Execute(string binary, string args)
{
var process = Process.Start(binary, args);
Console.WriteLine(process.StandardOutput.ReadToEnd());
Console.Error.WriteLine(process.StandardError.ReadToEnd());
process.WaitForExit();
}

[OneTimeTearDown]
public void TestDestroy()
{
Expand All @@ -79,6 +88,7 @@ public void TestDestroy()
{
Assert.Ignore();
}
Console.WriteLine("Test Done");
var binary = GetBinary();
Process.Start(binary, "-D test -j ACCEPT").WaitForExit();
Process.Start(binary, "-F test").WaitForExit();
Expand Down

0 comments on commit f5462ee

Please sign in to comment.