Skip to content

Commit

Permalink
continue tweaks. test works
Browse files Browse the repository at this point in the history
  • Loading branch information
dovholuknf committed Oct 1, 2023
1 parent c51e98a commit f41e9a5
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
6 changes: 6 additions & 0 deletions OpenZiti.NET/src/OpenZiti/Native/nAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,20 @@ limitations under the License.

using System;
using System.Net.Sockets;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: InternalsVisibleTo("UnitTests")]
namespace OpenZiti.Native {
public class API {
public const CallingConvention CALL_CONVENTION = CallingConvention.Cdecl;

public const string Z4D_DLL_PATH = @"ziti4dotnet";

public static string GetZitiPath() {
return Z4D_DLL_PATH;
}

#region //ziti.h - functions exported from the ziti-sdk-c project from ziti.h

//these functions should be declared in the same order as they appear in ziti.h to make diffing easier!
Expand Down
10 changes: 4 additions & 6 deletions TestProject/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,8 @@ public static async Task Main(string[] args) {

//create the service policies
var serviceRoles = new Roles() { $"#{testServices}" };
var dialRoles = new Roles() { $"#{svcName}.binders" };
var bindRoles = new Roles() { $"#{svcName}.dialers" };
//var dialRoles = new Roles() { $"#{svcName}.dialers" };
//var bindRoles = new Roles() { $"#{svcName}.binders" };
var dialRoles = new Roles() { $"#{svcName}.dialers" };
var bindRoles = new Roles() { $"#{svcName}.binders" };

await h.DeleteServicePolicyByNameAsync($"{svcName}.sp.dial");
var createServicePolicy = new ServicePolicyCreate {
Expand Down Expand Up @@ -157,8 +155,8 @@ public static async Task Main(string[] args) {
string tempFilePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
System.IO.File.WriteAllBytes(tempFilePath, Encoding.UTF8.GetBytes(zitiId));

//Console.WriteLine("Waiting 10 seconds for router to receive the service");
//await Task.Delay(10000);
Console.WriteLine("Waiting 10 seconds for router to receive the service");
await Task.Delay(10000);

var c = new ZitiContext(tempFilePath);
var zitiSocketHandler = c.NewZitiSocketHandler(svcName);
Expand Down
17 changes: 17 additions & 0 deletions TestProject/Properties/launchSettings.json.back
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"profiles": {
"TestProject": {
"commandName": "Project",
"commandLineArgs": "args0 test weather c:\\git\\github\\openziti\\ziti-sdk-csharp\\Samples\\setup-scripts\\enroll.demo.json",
"environmentVariables": {
"ZITI_USERNAME": "admin",
"ZITI_PASSWORD": "cdaws8086"
},
"nativeDebugging": true
},
"WSL": {
"commandName": "WSL2",
"distributionName": ""
}
}
}

0 comments on commit f41e9a5

Please sign in to comment.