add mono client test

This commit is contained in:
Martin Regen
2018-01-12 15:09:00 +01:00
parent ac4ac4086c
commit 2acfcc0a30
13 changed files with 95 additions and 39 deletions
+2
View File
@@ -51,6 +51,8 @@ script:
- msbuild /p:configuration=Release /t:compile,publish SampleApplications/Samples/NetCoreConsoleServer/MonoConsoleServer.csproj
- cd SampleApplications/Samples/NetCoreConsoleServer/bin/Debug/net46
- mono MonoConsoleServer.exe -t 10 -a
- cd $TRAVIS_BUILD_DIR
- ./testmonoclientserver.sh
after_script:
- echo "========== build done ============"
@@ -69,18 +69,9 @@
<Reference Include="System.Runtime.Serialization">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="System.Security.Cryptography.Encoding, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.X509Certificates, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll</HintPath>
</Reference>
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.XmlDocument, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\System.Xml.XmlDocument.4.3.0\lib\net46\System.Xml.XmlDocument.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Browse\AttrbuteListCtrl.Designer.cs">
@@ -1022,9 +1013,6 @@
<None Include="app.config">
<SubType>Designer</SubType>
</None>
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Stack\Opc.Ua.Core\Opc.Ua.Core.csproj">
@@ -1054,4 +1042,4 @@
<PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
</Project>
</Project>
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net46" />
<package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="net46" requireReinstallation="true" />
<package id="System.Xml.XmlDocument" version="4.3.0" targetFramework="net461" />
</packages>
@@ -0,0 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net46</TargetFramework>
<AssemblyName>MonoConsoleClient</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>MonoConsoleClient</PackageId>
<Company>OPC Foundation</Company>
<Product>OPC UA SDK</Product>
<Description>Mono Console Client</Description>
<Copyright>Copyright © 2004-2018 OPC Foundation, Inc</Copyright>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Stack\Opc.Ua.Core\Opc.Ua.Core.csproj" />
<ProjectReference Include="..\..\SDK\Opc.Ua.Client\Opc.Ua.Client.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Mono.Options" Version="5.3.0.1" />
</ItemGroup>
</Project>
@@ -5,6 +5,10 @@
<AssemblyName>NetCoreConsoleClient</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>NetCoreConsoleClient</PackageId>
<Company>OPC Foundation</Company>
<Product>OPC UA SDK</Product>
<Description>.Net Core Console Client</Description>
<Copyright>Copyright © 2004-2018 OPC Foundation, Inc</Copyright>
</PropertyGroup>
<ItemGroup>
@@ -77,7 +77,9 @@ namespace NetCoreConsoleClient
if (showHelp)
{
// show some app description message
Console.WriteLine("Usage: dotnet NetCoreConsoleClient.dll [OPTIONS] [ENDPOINTURL]");
Console.WriteLine(Utils.IsRunningOnMono() ?
"Usage: mono MonoConsoleClient.exe [OPTIONS] [ENDPOINTURL]" :
"Usage: dotnet NetCoreConsoleClient.dll [OPTIONS] [ENDPOINTURL]");
Console.WriteLine();
// output the options
@@ -209,7 +209,7 @@
</Extensions>
<TraceConfiguration>
<OutputFilePath>./Opc.Ua.SampleServer.log.txt</OutputFilePath>
<OutputFilePath>./Opc.Ua.MonoSampleServer.log.txt</OutputFilePath>
<DeleteOnLoad>true</DeleteOnLoad>
<!-- Show Only Errors -->
<!-- <TraceMasks>1</TraceMasks> -->
@@ -105,7 +105,7 @@ namespace NetCoreConsoleServer
if (showHelp)
{
Console.WriteLine("Usage: dotnet NetCoreConsoleServer.dll [OPTIONS]");
Console.WriteLine(Utils.IsRunningOnMono() ? "Usage: mono MonoConsoleServer.exe [OPTIONS]" : "Usage: dotnet NetCoreConsoleServer.dll [OPTIONS]" );
Console.WriteLine();
Console.WriteLine("Options:");
@@ -210,11 +210,7 @@ namespace NetCoreConsoleServer
application.ApplicationName = "UA Core Sample Server";
application.ApplicationType = ApplicationType.Server;
#if NET46
application.ConfigSectionName = "Opc.Ua.MonoSampleServer";
#else
application.ConfigSectionName = "Opc.Ua.SampleServer";
#endif
application.ConfigSectionName = Utils.IsRunningOnMono() ? "Opc.Ua.MonoSampleServer" : "Opc.Ua.SampleServer";
// load the application configuration.
ApplicationConfiguration config = await application.LoadApplicationConfiguration(false);
@@ -91,7 +91,7 @@ namespace Quickstarts.ReferenceServer
{
public static int Main(string[] args)
{
Console.WriteLine(".Net Core OPC UA Reference Server");
Console.WriteLine("{0} OPC UA Reference Server", Utils.IsRunningOnMono() ? "Mono" : ".Net Core");
// command line options
bool showHelp = false;
@@ -119,7 +119,7 @@ namespace Quickstarts.ReferenceServer
if (showHelp)
{
Console.WriteLine("Usage: dotnet ConsoleReferenceServer.dll [OPTIONS]");
Console.WriteLine(Utils.IsRunningOnMono() ? "Usage: mono MonoReferenceServer.exe [OPTIONS]" : "Usage: dotnet ConsoleReferenceServer.dll [OPTIONS]");
Console.WriteLine();
Console.WriteLine("Options:");
@@ -223,11 +223,7 @@ namespace Quickstarts.ReferenceServer
application.ApplicationName = "Quickstart Reference Server";
application.ApplicationType = ApplicationType.Server;
#if NET46
application.ConfigSectionName = "Quickstarts.MonoReferenceServer";
#else
application.ConfigSectionName = "Quickstarts.ReferenceServer";
#endif
application.ConfigSectionName = Utils.IsRunningOnMono() ? "Quickstarts.MonoReferenceServer" : "Quickstarts.ReferenceServer";
// load the application configuration.
ApplicationConfiguration config = await application.LoadApplicationConfiguration(false);
@@ -15,7 +15,7 @@
<ApplicationCertificate>
<StoreType>Directory</StoreType>
<StorePath>./OPC Foundation/PKI/own</StorePath>
<SubjectName>CN=Quickstart Reference Server, C=US, S=Arizona, O=OPC Foundation, DC=localhost</SubjectName>
<SubjectName>CN=Quickstart Mono Reference Server, C=US, S=Arizona, O=OPC Foundation, DC=localhost</SubjectName>
</ApplicationCertificate>
<!-- Where the issuer certificate are stored (certificate authorities) -->
+1 -1
View File
@@ -4,7 +4,7 @@
#---------------------------------#
# version format
version: 1.3.350.{build}-{branch}
version: 1.3.351.{build}-{branch}
# branches to build
+3 -3
View File
@@ -1,5 +1,5 @@
#!/bin/bash
echo Test the console server and console client
echo Test the .Net Core console server and console client
workdir=$(pwd)
testresult=0
@@ -13,9 +13,9 @@ cd $workdir
cd SampleApplications/Samples/NetCoreConsoleClient
echo build client
dotnet build
dotnet build NetCoreConsoleServer.csproj
echo start client
dotnet run --no-restore --no-build -t 20 &
dotnet run --no-restore --no-build --project NetCoreConsoleServer.csproj -t 20 &
clientpid="$!"
cd $workdir
+47
View File
@@ -0,0 +1,47 @@
#!/bin/bash
echo Test the Mono console server and console client
workdir=$(pwd)
testresult=0
cd SampleApplications/Samples/NetCoreConsoleServer
echo build server
msbuild /p:configuration=Debug /t:restore,compile MonoConsoleServer.csproj
echo start server
cd SampleApplications/Samples/NetCoreConsoleServer/bin/Debug/net46
mono MonoConsoleServer.exe -t 60 -a &
serverpid="$!"
cd $workdir
cd SampleApplications/Samples/NetCoreConsoleClient
echo build client
msbuild /p:configuration=Debug /t:restore,compile MonoConsoleClient.csproj
echo start client
cd SampleApplications/Samples/NetCoreConsoleClient/bin/Debug/net46
mono MonoConsoleClient.exe -t 20 &
clientpid="$!"
cd $workdir
echo wait for client
wait $clientpid
if [ $? -eq 0 ]; then
echo "SUCCESS - Client test passed"
else
testresult=$?
echo "FAILED - Client test failed with a status of $testresult"
fi
echo wait for server
wait $serverpid
serverresult=$?
if [ $? -eq 0 ]; then
echo "SUCCESS - Server test passed"
else
testresult=$?
echo "FAILED - Server test failed with a status of $testresult"
fi
exit $testresult