NGINX and MySQL end-to-end tests

This commit is contained in:
clemensv 2019-12-09 21:27:17 +01:00
Родитель df3bb1fc32
Коммит acc309ae0a
58 изменённых файлов: 766 добавлений и 332 удалений

Просмотреть файл

@ -2,6 +2,8 @@
[![Build Status](https://clemensv.visualstudio.com/azure-relay-bridge/_apis/build/status/clemensv.azure-relay-bridge?branchName=master)](https://clemensv.visualstudio.com/azure-relay-bridge/_build/latest?definitionId=1&branchName=master)
> _NOTE: This is an unsupported tool that is provided as-is. Azure product support is not available. Any issues must be filed here and there is no guaranteed reaction time for addressing any such issues._
The Azure Relay Bridge is a tool that allows creating TCP tunnels between any
pair of hosts, as long as those hosts each have outbound Internet connectivity on
port 443 (HTTPS) to the Azure Relay service.

Просмотреть файл

@ -6,7 +6,7 @@
<CoreFrameworks Condition="'$(WindowsOnly)'!='true'">netcoreapp3.0</CoreFrameworks>
<TargetFrameworks>$(WindowsFrameworks)$(CoreFrameworks)</TargetFrameworks>
<WindowsRuntimeIdentifiers Condition="'$(OS)'=='Windows_NT'">win7-x64;win7-x86;win10-x64;win10-x86;</WindowsRuntimeIdentifiers>
<UnixRuntimeIdentifiers Condition="'$(WindowsOnly)'=='false'">osx-x64;debian.10-x64;ubuntu.18.04-x64;opensuse.15.0-x64;fedora.30-x64</UnixRuntimeIdentifiers>
<UnixRuntimeIdentifiers Condition="'$(WindowsOnly)'=='false'">osx-x64;debian.9-x64;debian.10-x64;ubuntu.18.04-x64;opensuse.15.0-x64;fedora.30-x64</UnixRuntimeIdentifiers>
<RuntimeIdentifiers>$(WindowsRuntimeIdentifiers)$(UnixRuntimeIdentifiers)</RuntimeIdentifiers>
</PropertyGroup>

Двоичные данные
src/assets/assets.pptx Normal file

Двоичный файл не отображается.

Двоичные данные
src/assets/azurerelay.ico Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 294 KiB

Двоичные данные
src/assets/dlgbanner.bmp Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 85 KiB

Двоичные данные
src/assets/dlgbkgnd.bmp Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 451 KiB

Просмотреть файл

@ -1,32 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
<?xml version="1.0" encoding="UTF-8" ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
<Product Id="*" Name="Azure Relay Bridge" Language="1033" Version="1.0.0.0" Manufacturer="Microsoft" UpgradeCode="119729c9-25d5-447f-b9a8-5e2b1cdbc348">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" />
<Feature Id="ProductFeature" Title="azbridge_installer" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
<PropertyRef Id="WIX_ACCOUNT_NETWORKSERVICE" />
<PropertyRef Id="WIX_ACCOUNT_USERS" />
<PropertyRef Id="WIX_ACCOUNT_ADMINISTRATORS" />
<PropertyRef Id="WIX_IS_NETFRAMEWORK_452_OR_LATER_INSTALLED"/>
<PropertyRef Id="WIX_IS_NETFRAMEWORK_462_OR_LATER_INSTALLED" />
<WixVariable Id="WixUILicenseRtf" Value="$(var.ProjectDir)license.rtf" />
<Condition Message="This application requires .NET Framework 4.5.2 or later. Please install the .NET Framework then run this installer again.">
<![CDATA[Installed OR WIX_IS_NETFRAMEWORK_452_OR_LATER_INSTALLED]]>
<WixVariable Id="WixUIBannerBmp" Value="..\assets\dlgbanner.bmp" />
<WixVariable Id="WixUIDialogBmp" Value="..\assets\dlgbkgnd.bmp" />
<Condition Message="This application requires .NET Framework 4.6.2 or later. Please install the .NET Framework then run this installer again.">
<![CDATA[Installed OR WIX_IS_NETFRAMEWORK_462_OR_LATER_INSTALLED]]>
</Condition>
</Product>
<Property Id="INSTALL_SERVICE" Secure="yes" Value="0" />
<Property Id="INSTALL_PATH" Secure="yes" Value="1" />
<Feature Id="Service" Level="1" AllowAdvertise="yes" Title="Install as Service" Absent="allow">
<ComponentGroupRef Id="ProductComponents" />
<ComponentGroupRef Id="azbridge_Project" />
</Feature>
<Feature Id="PathInstall" Level="1" AllowAdvertise="yes" Title="Install Path" Absent="allow">
<ComponentGroupRef Id="PathInstall" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<!-- Note using the preprocessor variable here -->
<?if $(sys.BUILDARCH)=x64?>
<?if $(sys.BUILDARCH)=x64 ?>
<Directory Id="ProgramFiles64Folder">
<Directory Id="INSTALLFOLDER" Name="Azure Relay Bridge" />
</Directory>
@ -37,33 +43,113 @@
<?endif ?>
<Directory Id="CommonAppDataFolder">
<Directory Id="MicrosoftAppDataFolder" Name="Microsoft">
<Directory Id="CONFIGFOLDER" Name="Azure Relay Bridge"/>
<Directory Id="CONFIGFOLDER" Name="Azure Relay Bridge" />
</Directory>
</Directory>
</Directory>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
<UIRef Id="WixUI_InstallDir" />
<UIRef Id="WixUI_AzBridge" />
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="etwManifest.dll">
<File Id="etwManifest.dll" KeyPath="yes"
Source="$(var.Microsoft.Azure.Relay.Bridge.TargetDir)\Microsoft.Azure.Relay.Bridge.Microsoft-Azure-RelayBridge.etwManifest.dll" />
<File Id="etwManifest.dll" KeyPath="yes" Source="$(var.Microsoft.Azure.Relay.Bridge.TargetDir)\Microsoft.Azure.Relay.Bridge.Microsoft-Azure-RelayBridge.etwManifest.dll" />
</Component>
<Component Id="etwManifest.man">
<File Id="etwManifest.man" KeyPath="yes"
Source="$(var.Microsoft.Azure.Relay.Bridge.TargetDir)\Microsoft.Azure.Relay.Bridge.Microsoft-Azure-RelayBridge.etwManifest.man">
<File Id="etwManifest.man" KeyPath="yes" Source="$(var.Microsoft.Azure.Relay.Bridge.TargetDir)\Microsoft.Azure.Relay.Bridge.Microsoft-Azure-RelayBridge.etwManifest.man">
<util:EventManifest MessageFile="[etwManifest.dll]" ResourceFile="[etwManifest.dll]"></util:EventManifest>
</File>
</Component>
</ComponentGroup>
<ComponentGroup Id="PathInstall" Directory="INSTALLFOLDER">
<Component Id="Path" Guid="{bfc77cbe-3e65-4cb9-a1db-3d0b14bbe11f}" KeyPath="yes">
<Environment Id="PATH" Name="PATH" Value="[INSTALLFOLDER]" Permanent="no" Part="last" Action="set" System="yes" />
<CreateFolder/>
<CreateFolder />
<Condition>INSTALL_PATH = 1</Condition>
</Component>
</ComponentGroup>
<Feature Id="App" Title="Command line bridge" Level="1">
<ComponentGroupRef Id="azbridge_Project" />
</Feature>
</Fragment>
<Fragment>
<UI>
<Dialog Id="InstallServiceDlg" Width="370" Height="270" Title="[ProductName] Setup">
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="WixUI_Bmp_Banner" />
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="Description" Type="Text" X="25" Y="23" Width="340" Height="15" Transparent="yes" NoPrefix="yes" Text="Choose which additional options you want to enable." />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="{\WixUI_Font_Title}Installation Options" />
<Control Id="ChkBox1" Type="CheckBox" X="20" Y="80" Width="330" Height="20" Text="Add the installation directory to the system PATH." Property="INSTALL_PATH" CheckBoxValue="1" Default="yes" />
<Control Id="ChkBox2" Type="CheckBox" X="20" Y="120" Width="330" Height="20" Text="Install the Azure Relay Bridge as a Windows Service. This option enables the service to run in the background and independent of any logged on user." Property="INSTALL_SERVICE" CheckBoxValue="1" Default="no" />
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)"/>
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
</Dialog>
</UI>
</Fragment>
<Fragment>
<UI Id="WixUI_AzBridge">
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />
<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
<Property Id="WixUI_Mode" Value="InstallDir" />
<DialogRef Id="BrowseDlg" />
<DialogRef Id="DiskCostDlg" />
<DialogRef Id="ErrorDlg" />
<DialogRef Id="FatalError" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="MsiRMFilesInUse" />
<DialogRef Id="PrepareDlg" />
<DialogRef Id="ProgressDlg" />
<DialogRef Id="ResumeDlg" />
<DialogRef Id="UserExit" />
<Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath" Order="3">1</Publish>
<Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4">
<![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]>
</Publish>
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>
<Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg">LicenseAccepted = "1"</Publish>
<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3">
<![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]>
</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="InstallServiceDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>
<Publish Dialog="InstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>
<Publish Dialog="InstallServiceDlg" Control="Back" Event="NewDialog" Value="InstallDirDlg">1</Publish>
<Publish Dialog="InstallServiceDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="InstallServiceDlg" Order="1">NOT Installed</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">Installed AND PATCH</Publish>
<Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
<Property Id="ARPNOMODIFY" Value="1" />
</UI>
<UIRef Id="WixUI_Common" />
</Fragment>
</Wix>

Просмотреть файл

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Publish" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="packages\WiX.3.11.1\build\wix.props" Condition="Exists('packages\WiX.3.11.1\build\wix.props')" />
<Import Project="packages\WiX.3.11.2\build\wix.props" Condition="Exists('packages\WiX.3.11.2\build\wix.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<ProductVersion>3.10</ProductVersion>
@ -8,13 +8,15 @@
<SchemaVersion>2.0</SchemaVersion>
<OutputName>azbridge_installer</OutputName>
<OutputType>Package</OutputType>
<OutputPath>bin\$(Configuration)\$(Platform)\</OutputPath>
<AlreadyPublished>false</AlreadyPublished>
<EnableProjectHarvesting>false</EnableProjectHarvesting>
<DefineSolutionProperties>false</DefineSolutionProperties>
<BridgePublishPath>..\azbridge\bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish</BridgePublishPath>
<BridgePublishPath>..\azbridge\bin\$(Configuration)\$(Platform)\$(TargetFramework)\$(RuntimeIdentifier)\publish</BridgePublishPath>
<BridgeProjectFile>..\azbridge\azbridge.csproj</BridgeProjectFile>
<Platform Condition="'$(Platform)'=='' AND $(RuntimeIdentifier.EndsWith('x64'))">x64</Platform>
<Platform Condition="'$(Platform)'=='' AND $(RuntimeIdentifier.EndsWith('x86'))">x86</Platform>
<SuppressIces>ICE30</SuppressIces>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
@ -96,7 +98,7 @@
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('packages\WiX.3.11.1\build\wix.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\WiX.3.11.1\build\wix.props'))" />
<Error Condition="!Exists('packages\WiX.3.11.2\build\wix.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\WiX.3.11.2\build\wix.props'))" />
</Target>
<Target Name="Publish" DependsOnTargets="Build">
</Target>

Просмотреть файл

@ -0,0 +1 @@
msbuild /t:publish /p:AlreadyPublished=true /p:TargetFramework=net462 /p:Platform=x64 /p:Configuration=Debug /p:RuntimeIdentifier=win10-x64

Просмотреть файл

@ -1,42 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wix="http://schemas.microsoft.com/wix/2006/wi">
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:wix="http://schemas.microsoft.com/wix/2006/wi">
<xsl:output method="xml" indent="yes" />
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
<xsl:key name="azbridgesvc-srch" match="wix:Component[substring(wix:File/@Source, string-length(wix:File/@Source) - string-length('azbridge.exe') +1)='azbridge.exe']" use="@Id" />
<xsl:template match="wix:Component[key('azbridgesvc-srch', @Id)]">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates select="*|text()" />
<wix:ServiceInstall Id="InstallABS"
Name="azbridgesvc"
Description="Azure Relay Bridge Service"
Start="demand"
ErrorControl="normal"
Type="ownProcess"
Arguments="--svc"
Vital="yes"
Account="NT AUTHORITY\NETWORKSERVICE" />
<wix:ServiceControl Id="ControllABS"
Name="azbridgesvc"
Start="install"
Stop="both"
Remove="uninstall"
Wait="yes" />
<xsl:attribute name="Guid">{098E424F-CABA-4217-80CC-E4C58D10AE67}</xsl:attribute>
<xsl:attribute name="Id">ExeFile</xsl:attribute>
<wix:Condition>NOT INSTALL_SERVICE</wix:Condition>
<xsl:apply-templates select="*|text()">
<xsl:with-param name="fileid">ExeFileId</xsl:with-param>
</xsl:apply-templates>
</xsl:copy>
<xsl:copy>
<xsl:attribute name="Guid">{4DD98183-3A32-4F6C-9008-77EE0ED0718A}</xsl:attribute>
<xsl:attribute name="Id">SvcFile</xsl:attribute>
<wix:Condition>INSTALL_SERVICE</wix:Condition>
<xsl:apply-templates select="*|text()">
<xsl:with-param name="fileid">SvcFileId</xsl:with-param>
</xsl:apply-templates>
<wix:ServiceInstall Id="InstallABS" Name="azbridgesvc" Description="Azure Relay Bridge Service" Start="demand" ErrorControl="normal" Type="ownProcess" Arguments="--svc" Vital="yes" Account="NT AUTHORITY\NETWORKSERVICE" />
<wix:ServiceControl Id="ControllABS" Name="azbridgesvc" Start="install" Stop="both" Remove="uninstall" Wait="yes" />
</xsl:copy>
</xsl:template>
<xsl:key name="azbridge-svc-config" match="wix:File[substring(@Source, string-length(@Source) - string-length('azbridge_config.svc.yml') +1)='azbridge_config.svc.yml']" use="@Id" />
<xsl:key name="azbridge-machine-config" match="wix:File[substring(@Source, string-length(@Source) - string-length('azbridge_config.machine.yml') +1)='azbridge_config.machine.yml']" use="@Id" />
<xsl:key name="azbridge-exe" match="wix:File[substring(@Source, string-length(@Source) - string-length('azbridge.exe') +1)='azbridge.exe']" use="@Id" />
<xsl:template match="wix:Wix/wix:Fragment[1]">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:copy-of select="@*" />
<wix:DirectoryRef Id="CONFIGFOLDER">
<xsl:apply-templates select="//wix:Component/wix:File[key('azbridge-svc-config', @Id)]|//wix:Component/wix:File[key('azbridge-machine-config', @Id)]" />
</wix:DirectoryRef>
@ -46,16 +45,16 @@ xmlns:wix="http://schemas.microsoft.com/wix/2006/wi">
<xsl:template match="wix:DirectoryRef[@Id='INSTALLFOLDER']">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:copy-of select="@*" />
<xsl:apply-templates select="*[not(self::wix:Component/wix:File[key('azbridge-svc-config', @Id)] or self::wix:Component/wix:File[key('azbridge-machine-config', @Id)])]|text()" />
</xsl:copy>
</xsl:template>
<xsl:template match="wix:Component/wix:File[key('azbridge-svc-config', @Id)]">
<wix:Component>
<xsl:copy-of select="../@*"/>
<xsl:copy-of select="../@*" />
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:copy-of select="@*" />
<xsl:apply-templates select="*|text()" />
<wix:Permission User="[WIX_ACCOUNT_ADMINISTRATORS]" FileAllRights="yes" />
<wix:Permission User="[WIX_ACCOUNT_USERS]" GenericRead="yes" Read="yes" />
@ -66,9 +65,9 @@ xmlns:wix="http://schemas.microsoft.com/wix/2006/wi">
<xsl:template match="wix:Component/wix:File[key('azbridge-machine-config', @Id)]">
<wix:Component>
<xsl:copy-of select="../@*"/>
<xsl:copy-of select="../@*" />
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:copy-of select="@*" />
<xsl:apply-templates select="*|text()" />
<wix:Permission User="[WIX_ACCOUNT_ADMINISTRATORS]" FileAllRights="yes" />
<wix:Permission User="[WIX_ACCOUNT_USERS]" GenericRead="yes" Read="yes" />
@ -77,4 +76,20 @@ xmlns:wix="http://schemas.microsoft.com/wix/2006/wi">
</wix:Component>
</xsl:template>
<xsl:template match="wix:File[key('azbridge-exe', @Id)]">
<xsl:param name="fileid" />
<xsl:copy>
<xsl:attribute name="Id">
<xsl:value-of select="$fileid" />
</xsl:attribute>
<xsl:apply-templates select="node()|@KeyPath|@Source" />
</xsl:copy>
</xsl:template>
<xsl:key name="azbridgesvc-srch-any" match="//wix:Component[substring(wix:File/@Source, string-length(wix:File/@Source) - string-length('azbridge.exe') +1)='azbridge.exe']" use="@Id" />
<xsl:template match="wix:ComponentRef[key('azbridgesvc-srch-any', @Id)]">
<wix:ComponentRef Id="SvcFile" />
<wix:ComponentRef Id="ExeFile" />
</xsl:template>
</xsl:stylesheet>

Просмотреть файл

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="WiX" version="3.11.1" targetFramework="net462" />
<package id="WiX" version="3.11.2" targetFramework="net462" />
</packages>

Просмотреть файл

@ -0,0 +1,8 @@
rem Check whether we are elevated and if not, restart the script elevated:
openfiles >nul 2>&1
if %ErrorLevel% neq 0 (
powershell.exe -Command "Start-Process cmd \"%*\" -Verb RunAs"
exit
)
echo "Hi there"

Просмотреть файл

@ -1,10 +0,0 @@
node_modules
npm-debug.log
Dockerfile*
docker-compose*
.dockerignore
.git
.gitignore
README.md
LICENSE
.vscode

1
test/docker/.gitattributes поставляемый
Просмотреть файл

@ -1 +0,0 @@
*.txt eol=lf

Просмотреть файл

@ -1,21 +0,0 @@
echo off
echo Running %_TESTNAME%
set _OUTFILE=%temp%\azbridge-tests-%_TESTNAME%.output.txt
docker run -v %_MOUNTPATH%:/tests -e AZBRIDGE_TEST_CXNSTRING=%AZBRIDGE_TEST_CXNSTRING% --rm azbridge-test-%ImageName%:latest bash /tests/%_TESTNAME%.sh > %_OUTFILE%
if exist %_MOUNTPATH%\%_TESTNAME%.reference.txt (
fc /L %_MOUNTPATH%\%_TESTNAME%.reference.txt %_OUTFILE% > NUL
if ERRORLEVEL 1 (
set _RESULT=%ERRORLEVEL%
type %_OUTFILE%
echo Error %_RESULT%
)
if ERRORLEVEL 0 (
set _RESULT=0
echo OK
)
del %_OUTFILE%
) else (
copy /Y %_OUTFILE% %_MOUNTPATH%\%_TESTNAME%.reference.txt > NUL
set _RESULT=%ERRORLEVEL%
)
exit /b %_RESULT%

Просмотреть файл

@ -1,18 +0,0 @@
#!/bin/bash
echo Running $_TESTNAME
_OUTFILE=$(mktemp)
docker run -v $_MOUNTPATH:/tests -e AZBRIDGE_TEST_CXNSTRING="$_CXNSTRING" --rm $IMAGE_NAME:latest bash /tests/$_TESTNAME.sh > $_OUTFILE
if [ -f $_MOUNTPATH/$_TESTNAME.reference.txt ]; then
diff --strip-trailing-cr -B -i -w $_MOUNTPATH/$_TESTNAME.reference.txt $_OUTFILE > /dev/null 2>&1
_RESULT=$?
if [ $_RESULT -eq 0 ]; then
echo OK
else
diff --strip-trailing-cr -B -i -w $_MOUNTPATH/$_TESTNAME.reference.txt $_OUTFILE
fi
else
cp $_OUTFILE $_MOUNTPATH/$_TESTNAME.reference.txt > /dev/null 2>&1
_RESULT=0
fi
rm $_OUTFILE
echo $_TESTNAME done.

Просмотреть файл

@ -1,62 +0,0 @@
rem @echo off
echo %~1 %~2 %~3 %~4 %~5 %~6
if not "%~1" == "" set Operation=%~1
if not "%~2" == "" set ImageName=%~2
if not "%~3" == "" set ImageSuffix=%~3
if not "%~4" == "" set VersionPrefix=%~4
if not "%~5" == "" set VersionSuffix=%~5
if not "%~6" == "" set TargetFramework=%~6
if "%Operation%"=="" set Operation=build
if "%ImageName%"=="" set ImageName=debian.9-x64
if "%ImageSuffix%"=="" set ImageSuffix=deb
if "%VersionSuffix%"=="" set VersionSuffix=preview
if "%VersionPrefix%"=="" set VersionPrefix=1.0.0
if "%TargetFramework%"=="" set TargetFramework=netcoreapp3.0
set PackageName=azbridge.%VersionPrefix%-%VersionSuffix%.%ImageName%.%ImageSuffix%
if "%Operation%"=="build" (
pushd "%~dp0"
if NOT exist ..\..\artifacts\build\%TargetFramework%\%PackageName% (
echo Cannot find ..\..\artifacts\build\%TargetFramework%\%PackageName%
exit 2
)
if not exist "tmp" mkdir tmp
copy /y ..\..\artifacts\build\%TargetFramework%\%PackageName% tmp > NUL
docker build -f %ImageName%.dockerfile . --tag azbridge-test-%ImageName% --build-arg package_name=%PackageName%
rd /s /q tmp
popd
exit /b
)
if "%Operation%"=="test" (
if %AZBRIDGE_TEST_CXNSTRING% == "" (
echo AZBRIDGE_TEST_CXNSTRING environment variable must be set to valid relay connection string
exit /b
)
set _IMAGE_ID=
FOR /F %%i IN ("%cd%") DO set _MOUNTPATH=%%~fi
set _TESTNAME=test_nc_ping_pong
call runtest.cmd
if NOT "%_RESULT%"=="0" exit /b %_RESULT%
set _TESTNAME=test_nc_config_ping_pong
call runtest.cmd
exit /b %_RESULT%
)
if "%Operation%"=="clean" (
set IMAGE_NAME=azbridge-test-%ImageName%
for /f %%i in ('docker images %IMAGE_NAME% -q') do set _IMAGE_ID=%%i
if "%_IMAGE_ID%"=="" exit /b
docker rmi -f %IMAGE_NAME%:latest
)
else (
echo "Unknown operation"
)

Просмотреть файл

@ -1,55 +0,0 @@
#!/bin/bash
if [ ! -z $1 ]; then Operation=$1; fi
if [ ! -z $2 ]; then ImageName=$2; fi
if [ ! -z $3 ]; then ImageSuffix=$3; fi
if [ ! -z $4 ]; then VersionPrefix=$4; fi
if [ ! -z $5 ]; then VersionSuffix=$5; fi
if [ ! -z $6 ]; then TargetFramework=$6; fi
if [ -z ${Operation+x} ]; then Operation='build'; fi
if [ -z ${ImageName+x} ]; then ImageName='debian.8-x64'; fi
if [ -z ${ImageSuffix+x} ]; then VersionSuffix='deb'; fi
if [ -z ${VersionSuffix+x} ]; then VersionSuffix='preview'; fi
if [ -z ${VersionPrefix+x} ]; then VersionPrefix='1.0.0'; fi
if [ -z ${TargetFramework+x} ]; then TargetFramework='netcoreapp3.0'; fi
if [ "${Operation}" == "build" ]; then
pushd "${0%/*}" > /dev/null
if [ ! -d "tmp" ]; then mkdir tmp; fi
PackageName=azbridge.$VersionPrefix-$VersionSuffix.$ImageName.$ImageSuffix
cp ../../artifacts/build/$TargetFramework/$PackageName tmp/ > /dev/null
docker build -f $ImageName.dockerfile . --tag azbridge-test-$ImageName --build-arg package_name=$PackageName
rm -rf tmp
popd
else
if [ "${Operation}" == "test" ]; then
pushd "${0%/*}" > /dev/null
IMAGE_NAME=azbridge-test-$ImageName
_CXNSTRING=$AZBRIDGE_TEST_CXNSTRING
if [ -z $_CXNSTRING ]; then
echo AZBRIDGE_TEST_CXNSTRING environment variable must be set to valid relay connection string
exit
fi
_MOUNTPATH=$(pwd)
_TESTNAME=test_nc_ping_pong
source runtest.sh
#if [ $_RESULT -ne 0 ]; then exit $_RESULT; fi
_TESTNAME=test_nc_config_ping_pong
source runtest.sh
popd
#exit $_RESULT
exit
else
if [ "${Operation}" == "clean" ]; then
if [ ! -z `docker images "azbridge-test-$ImageName" -q` ]; then
docker rmi -f azbridge_test_$ImageName:latest
fi
else
echo "Unknown command"
fi
fi
fi

Просмотреть файл

@ -1,2 +0,0 @@
the quick brown fox jumps over the lazy dog
etaoin shrdlu

Просмотреть файл

@ -1,10 +0,0 @@
#!/bin/bash
/usr/share/azbridge/azbridge -v -l ~/applog.log -x $AZBRIDGE_TEST_CXNSTRING -f /tests/test_nc_config_ping_pong.yml &
L1_PID=$!
sleep 15
echo "the quick brown fox jumps over the lazy dog" | nc -l 9999 &
sleep 5
echo "etaoin shrdlu" | nc -w 5 127.0.8.1 8888
sleep 5
kill -9 $L1_PID

Просмотреть файл

@ -1,11 +0,0 @@
LocalForward:
- RelayName: a1
BindAddress: 127.0.8.1
BindPort: 8888
PortName: test
RemoteForward:
- RelayName: a1
HostPort: 9999
Host: localhost
PortName: test

Просмотреть файл

@ -1,2 +0,0 @@
the quick brown fox jumps over the lazy dog
etaoin shrdlu

Просмотреть файл

@ -1,10 +0,0 @@
#!/bin/bash
/usr/share/azbridge/azbridge -v -l ~/applog.log -x $AZBRIDGE_TEST_CXNSTRING -L 127.0.8.1:8888/test:a1 -R a1:test/9999 &
L1_PID=$!
sleep 15
echo "the quick brown fox jumps over the lazy dog" | nc -l 9999 &
sleep 5
echo "etaoin shrdlu" | nc -w 5 127.0.8.1 8888
sleep 5
kill -9 $L1_PID

2
test/mysql/.gitignore поставляемый Normal file
Просмотреть файл

@ -0,0 +1,2 @@
downloaded.txt
*.log

Просмотреть файл

21
test/mysql/Test.proj Normal file
Просмотреть файл

@ -0,0 +1,21 @@
<Project>
<Import Project="Directory.Build.props" />
<PropertyGroup>
<OutputType>None</OutputType>
<RuntimeIdentifier>debian.9-x64</RuntimeIdentifier>
<ImageSuffix>deb</ImageSuffix>
</PropertyGroup>
<Target Name="Build">
<Exec Command="test.cmd build &quot;$(RuntimeIdentifier)&quot; &quot;$(ImageSuffix)&quot; &quot;$(VersionPrefix)&quot; &quot;$(VersionSuffix)&quot; &quot;$(TargetFramework)&quot;" Condition="'$(OS)'=='Windows_NT'"/>
<Exec Command="bash ./test.sh build &quot;$(RuntimeIdentifier)&quot; &quot;$(ImageSuffix)&quot; &quot;$(VersionPrefix)&quot; &quot;$(VersionSuffix)&quot; &quot;$(TargetFramework)&quot;" Condition="'$(OS)'=='Unix'"/>
</Target>
<Target Name="VSTest">
<Exec Command="test.cmd test &quot;$(RuntimeIdentifier)&quot; &quot;$(ImageSuffix)&quot; &quot;$(VersionPrefix)&quot; &quot;$(VersionSuffix)&quot; &quot;$(TargetFramework)&quot;" Condition="'$(OS)'=='Windows_NT'"/>
<Exec Command="bash ./test.sh test &quot;$(RuntimeIdentifier)&quot; &quot;$(ImageSuffix)&quot; &quot;$(VersionPrefix)&quot; &quot;$(VersionSuffix)&quot; &quot;$(TargetFramework)&quot;" Condition="'$(OS)'=='Unix'"/>
</Target>
<Target Name="Clean">
<Exec Command="test.cmd clean &quot;$(RuntimeIdentifier)&quot; &quot;$(ImageSuffix)&quot; &quot;$(VersionPrefix)&quot; &quot;$(VersionSuffix)&quot; &quot;$(TargetFramework)&quot;" Condition="'$(OS)'=='Windows_NT'"/>
<Exec Command="bash ./test.sh clean &quot;$(RuntimeIdentifier)&quot; &quot;$(ImageSuffix)&quot; &quot;$(VersionPrefix)&quot; &quot;$(VersionSuffix)&quot; &quot;$(TargetFramework)&quot;" Condition="'$(OS)'=='Unix'"/>
</Target>
</Project>

Просмотреть файл

@ -0,0 +1,4 @@
#!/bin/bash
/usr/share/azbridge/azbridge -v -l /tests/applog.log -x $AZBRIDGE_TEST_CXNSTRING -R a2:test/3306 &
mysql-docker-entrypoint.sh $@

11
test/mysql/my.cnf Normal file
Просмотреть файл

@ -0,0 +1,11 @@
[mysqld]
user=mysql
default_authentication_plugin=mysql_native_password
[mysql]
user=mysql
password=PaSsWoRd112233
[mysql]
user=root
password=PaSsWoRd112233

Просмотреть файл

@ -0,0 +1,6 @@
FROM debian:stretch AS build
ARG package_name
COPY ./tmp/$package_name .
RUN apt-get update -y
RUN apt-get install -y ./$package_name mysql-client

Просмотреть файл

@ -0,0 +1,7 @@
FROM mysql:5 AS build
ARG package_name
COPY ./tmp/$package_name .
RUN apt-get update -y
RUN apt-get install -y ./$package_name
RUN mv /usr/local/bin/docker-entrypoint.sh /usr/local/bin/mysql-docker-entrypoint.sh
COPY docker-entrypoint.sh /usr/local/bin/

4
test/mysql/run_client.sh Normal file
Просмотреть файл

@ -0,0 +1,4 @@
#!/bin/bash
/usr/share/azbridge/azbridge -v -l /tests/clientlog.log -x $AZBRIDGE_TEST_CXNSTRING -L 127.0.9.1:3306/test:a2 &
sleep 5
mysql --defaults-extra-file=/tests/my.cnf -h 127.0.9.1 < /tests/test.sql

78
test/mysql/test.cmd Normal file
Просмотреть файл

@ -0,0 +1,78 @@
rem @echo off
echo %~1 %~2 %~3 %~4 %~5 %~6
if not "%~1" == "" set Operation=%~1
if not "%~2" == "" set ImageName=%~2
if not "%~3" == "" set ImageSuffix=%~3
if not "%~4" == "" set VersionPrefix=%~4
if not "%~5" == "" set VersionSuffix=%~5
if not "%~6" == "" set TargetFramework=%~6
if "%Operation%"=="" set Operation=build
if "%ImageName%"=="" set ImageName=ubuntu.18.04-x64
if "%ImageSuffix%"=="" set ImageSuffix=deb
if "%VersionSuffix%"=="" set VersionSuffix=preview
if "%VersionPrefix%"=="" set VersionPrefix=1.0.0
if "%TargetFramework%"=="" set TargetFramework=netcoreapp3.0
set PackageName=azbridge.%VersionPrefix%-%VersionSuffix%.%ImageName%.%ImageSuffix%
pushd "%~dp0"
set _MOUNTPATH=%cd%
if "%Operation%"=="build" (
if NOT exist ..\..\artifacts\build\%TargetFramework%\%PackageName% (
echo Cannot find ..\..\artifacts\build\%TargetFramework%\%PackageName%
exit 2
)
if not exist "tmp" mkdir tmp
copy /y ..\..\artifacts\build\%TargetFramework%\%PackageName% tmp > NUL
docker build -f mysql.server.dockerfile . --tag azbridge-mysql-server --build-arg package_name=%PackageName%
docker build -f mysql.client.dockerfile . --tag azbridge-mysql-client --build-arg package_name=%PackageName%
rd /s /q tmp
popd
exit /b
)
if "%Operation%"=="test" (
goto test
)
if "%Operation%"=="clean" (
goto clean
)
else (
echo "Unknown operation"
)
exit
:test
if %AZBRIDGE_TEST_CXNSTRING% == "" (
echo AZBRIDGE_TEST_CXNSTRING environment variable must be set to valid relay connection string
exit /b
)
rem start the web server
docker run -v %_MOUNTPATH%:/tests -d -v %_MOUNTPATH%/my.cnf:/etc/mysqld/conf.d/my.cnf --rm -d -e AZBRIDGE_TEST_CXNSTRING=%AZBRIDGE_TEST_CXNSTRING% -e MYSQL_ROOT_PASSWORD=PaSsWoRd112233 -e MYSQL_PASSWORD=PaSsWoRd112233 -e MYSQL_USER=mysql azbridge-mysql-server:latest > srvrun.log
for /f %%i in ( srvrun.log ) do set _SERVER_NAME=%%i
rem run the client
ping -n 10 127.0.0.1 > NUL
docker run -v %_MOUNTPATH%:/tests -v %_MOUNTPATH%/my.cnf:/home/mysql/.my.cnf --rm -i -e AZBRIDGE_TEST_CXNSTRING=%AZBRIDGE_TEST_CXNSTRING% azbridge-mysql-client:latest bash /tests/run_client.sh
set RESULT=ERRORLEVEL
rem stop the web server
docker stop %_SERVER_NAME%
exit %RESULT%
:clean
set IMAGE_NAME=%ImageName%
for /f %%i in ('docker images %IMAGE_NAME% -q') do set _IMAGE_ID=%%i
if "%_IMAGE_ID%"=="" exit /b
docker rmi -f %IMAGE_NAME%:latest
exit

84
test/mysql/test.sh Normal file
Просмотреть файл

@ -0,0 +1,84 @@
#!/bin/bash
if [ ! -z $1 ]; then Operation=$1; fi
if [ ! -z $2 ]; then ImageName=$2; fi
if [ ! -z $3 ]; then ImageSuffix=$3; fi
if [ ! -z $4 ]; then VersionPrefix=$4; fi
if [ ! -z $5 ]; then VersionSuffix=$5; fi
if [ ! -z $6 ]; then TargetFramework=$6; fi
if [ -z ${Operation+x} ]; then Operation='build'; fi
if [ -z ${ImageName+x} ]; then ImageName='ubuntu.18.04-x64'; fi
if [ -z ${ImageSuffix+x} ]; then VersionSuffix='deb'; fi
if [ -z ${VersionSuffix+x} ]; then VersionSuffix='preview'; fi
if [ -z ${VersionPrefix+x} ]; then VersionPrefix='1.0.0'; fi
if [ -z ${TargetFramework+x} ]; then TargetFramework='netcoreapp3.0'; fi
echo $@
PackageName=azbridge.$VersionPrefix-$VersionSuffix.$ImageName.$ImageSuffix
if [ "${Operation}" == "build" ]; then
pushd "${0%/*}" > /dev/null
if [ ! -d "tmp" ]; then mkdir tmp; fi
cp ../../artifacts/build/$TargetFramework/$PackageName tmp/ > /dev/null
docker build -f mysql.server.dockerfile . --tag azbridge-mysql-server --build-arg package_name=$PackageName
_RESULT=$?
if [ $_RESULT -ne 0 ]; then
rm -rf tmp
popd
exit $_RESULT
fi
docker build -f mysql.client.dockerfile . --tag azbridge-mysql-client --build-arg package_name=$PackageName
_RESULT=$?
if [ $_RESULT -ne 0 ]; then
rm -rf tmp
popd
exit $_RESULT
fi
rm -rf tmp
popd
else
if [ "${Operation}" == "test" ]; then
pushd "${0%/*}" > /dev/null
IMAGE_NAME=$PackageName
_CXNSTRING=$AZBRIDGE_TEST_CXNSTRING
if [ -z $_CXNSTRING ]; then
echo AZBRIDGE_TEST_CXNSTRING environment variable must be set to valid relay connection string
exit
fi
# start the web server
server_name=$(docker run -v $(pwd):/tests -d -v $(pwd)/my.cnf:/etc/mysqld/conf.d/my.cnf --rm -d -e AZBRIDGE_TEST_CXNSTRING="$_CXNSTRING" -e MYSQL_ROOT_PASSWORD=PaSsWoRd112233 -e MYSQL_PASSWORD=PaSsWoRd112233 -e MYSQL_USER=mysql azbridge-mysql-server:latest)
# wait for server to start
echo waiting 20 seconds
sleep 20
# run the client
docker run -v $(pwd):/tests -v $(pwd)/my.cnf:/home/mysql/.my.cnf --rm -i -e AZBRIDGE_TEST_CXNSTRING="$_CXNSTRING" azbridge-mysql-client:latest bash /tests/run_client.sh
_RESULT=$?
# stop the web server
docker stop $server_name
#diff --strip-trailing-cr -B -i -w downloaded.txt index.html
if [ $_RESULT -eq 0 ]; then
echo OK
exit 0
else
echo not ok
exit 1
fi
else
if [ "${Operation}" == "clean" ]; then
if [ ! -z `docker images "azbridge-mysql-server" -q` ]; then
docker rmi -f azbridge-mysql-server:latest
fi
if [ ! -z `docker images "azbridge-mysql-client" -q` ]; then
docker rmi -f azbridge-mysql-client:latest
fi
else
echo "Unknown command"
fi
fi
fi

3
test/mysql/test.sql Normal file
Просмотреть файл

@ -0,0 +1,3 @@
create database if not exists testdb;
use testdb;
drop database testdb;

2
test/nginx/.gitignore поставляемый Normal file
Просмотреть файл

@ -0,0 +1,2 @@
downloaded.txt
*.log

Просмотреть файл

@ -0,0 +1,3 @@
<Project>
<Import Project="..\Directory.Build.props" />
</Project>

Просмотреть файл

Просмотреть файл

@ -2,4 +2,5 @@ FROM debian:buster AS build
ARG package_name
COPY ./tmp/$package_name .
RUN apt-get update -y
RUN apt-get install -y apt-utils ./$package_name netcat-openbsd findutils
RUN apt-get install -y ./$package_name wget

Просмотреть файл

@ -0,0 +1,7 @@
FROM debian:buster AS build
ARG package_name
COPY ./tmp/$package_name .
RUN apt-get update -y
RUN apt-get install -y ./$package_name nginx
COPY index.html /var/www/html

Просмотреть файл

@ -0,0 +1,6 @@
FROM debian:stretch AS build
ARG package_name
COPY ./tmp/$package_name .
RUN apt-get update -y
RUN apt-get install -y ./$package_name wget

Просмотреть файл

@ -0,0 +1,7 @@
FROM debian:stretch AS build
ARG package_name
COPY ./tmp/$package_name .
RUN apt-get update -y
RUN apt-get install -y ./$package_name nginx
COPY index.html /var/www/html

Просмотреть файл

@ -1,5 +1,5 @@
FROM fedora:30 AS build
ARG package_name
COPY ./tmp/$package_name .
RUN yum install -y $package_name
RUN yum install -y nc findutils
RUN yum install -y ./$package_name wget

Просмотреть файл

@ -0,0 +1,6 @@
FROM fedora:30 AS build
ARG package_name
COPY ./tmp/$package_name .
RUN yum install -y ./$package_name nginx
COPY index.html /usr/share/nginx/html

43
test/nginx/index.html Normal file
Просмотреть файл

@ -0,0 +1,43 @@
<html>
<body>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus aliquam nisi vitae enim ultricies, quis tempor massa sodales. Donec eleifend ligula ipsum, vitae tristique turpis tincidunt at. Nam eleifend semper justo. Aliquam tempor gravida ex id luctus. Donec ante sapien, imperdiet vitae fringilla at, viverra vel nulla. Duis augue est, blandit eget turpis nec, faucibus placerat metus. Nulla sagittis elit nibh, vel rhoncus augue lacinia sed. Vivamus vitae orci vestibulum magna dignissim commodo sit amet aliquet nulla. Fusce posuere faucibus magna, pulvinar blandit enim dignissim sit amet. Nulla elementum nisl eget diam venenatis cursus ac quis elit. Aliquam facilisis sodales eleifend. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Suspendisse ullamcorper nulla in libero auctor, sit amet dignissim neque pharetra. Nunc vitae gravida ex. Etiam sem orci, elementum id fringilla a, egestas a lacus. Integer ante lorem, rhoncus in purus sit amet, mollis faucibus elit. Pellentesque eget ex quis dui tincidunt mattis tempus sed quam. Praesent ac vulputate velit. Aliquam erat volutpat.
Maecenas lacinia ex ut ligula tempus sollicitudin. Nulla facilisi. Donec lacus neque, porttitor eu tellus tincidunt, varius vestibulum augue. Praesent nec aliquet erat, a cursus sem. In quis turpis et ligula rhoncus tristique. Aenean scelerisque dui non metus sagittis efficitur. Vestibulum auctor sapien faucibus est ullamcorper convallis. Nullam fringilla purus sit amet rutrum sollicitudin. Nulla at ante egestas sapien scelerisque iaculis ut id dui. Nunc sagittis sapien nunc, quis iaculis eros luctus vitae. Integer a enim vitae nunc pellentesque tincidunt sit amet eget odio. Etiam vel leo a mi ultricies faucibus sit amet in purus. In fringilla convallis vehicula. Etiam dignissim semper commodo. Quisque euismod sodales rhoncus. Sed dapibus lacinia cursus.
Sed volutpat lectus nec mauris faucibus varius vel id ante. Sed dictum felis id mi porttitor mattis. Aenean in bibendum risus. Integer massa turpis, venenatis in odio eget, viverra semper ipsum. Suspendisse vel aliquam lorem. Aliquam nec dui ex. Phasellus tristique, neque sed fringilla congue, nisl ipsum hendrerit quam, suscipit laoreet sem lectus ac turpis. Donec rhoncus convallis dapibus. Sed ac dolor eget neque malesuada condimentum id commodo mauris. Maecenas aliquet massa sed magna porttitor feugiat non a ex.
Nam interdum, ex eget elementum efficitur, lorem urna hendrerit nisl, vitae iaculis ante mauris ut diam. Cras diam ex, aliquet aliquam tristique a, egestas lacinia massa. Aenean et velit vel metus varius porttitor. Vestibulum non sodales velit. Vivamus condimentum justo nec lectus aliquet interdum. Suspendisse in tempus orci, ac interdum nulla. Etiam id tincidunt lacus. Duis commodo ornare lectus, at efficitur turpis tempor sit amet.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus aliquam nisi vitae enim ultricies, quis tempor massa sodales. Donec eleifend ligula ipsum, vitae tristique turpis tincidunt at. Nam eleifend semper justo. Aliquam tempor gravida ex id luctus. Donec ante sapien, imperdiet vitae fringilla at, viverra vel nulla. Duis augue est, blandit eget turpis nec, faucibus placerat metus. Nulla sagittis elit nibh, vel rhoncus augue lacinia sed. Vivamus vitae orci vestibulum magna dignissim commodo sit amet aliquet nulla. Fusce posuere faucibus magna, pulvinar blandit enim dignissim sit amet. Nulla elementum nisl eget diam venenatis cursus ac quis elit. Aliquam facilisis sodales eleifend. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Suspendisse ullamcorper nulla in libero auctor, sit amet dignissim neque pharetra. Nunc vitae gravida ex. Etiam sem orci, elementum id fringilla a, egestas a lacus. Integer ante lorem, rhoncus in purus sit amet, mollis faucibus elit. Pellentesque eget ex quis dui tincidunt mattis tempus sed quam. Praesent ac vulputate velit. Aliquam erat volutpat.
Maecenas lacinia ex ut ligula tempus sollicitudin. Nulla facilisi. Donec lacus neque, porttitor eu tellus tincidunt, varius vestibulum augue. Praesent nec aliquet erat, a cursus sem. In quis turpis et ligula rhoncus tristique. Aenean scelerisque dui non metus sagittis efficitur. Vestibulum auctor sapien faucibus est ullamcorper convallis. Nullam fringilla purus sit amet rutrum sollicitudin. Nulla at ante egestas sapien scelerisque iaculis ut id dui. Nunc sagittis sapien nunc, quis iaculis eros luctus vitae. Integer a enim vitae nunc pellentesque tincidunt sit amet eget odio. Etiam vel leo a mi ultricies faucibus sit amet in purus. In fringilla convallis vehicula. Etiam dignissim semper commodo. Quisque euismod sodales rhoncus. Sed dapibus lacinia cursus.
Sed volutpat lectus nec mauris faucibus varius vel id ante. Sed dictum felis id mi porttitor mattis. Aenean in bibendum risus. Integer massa turpis, venenatis in odio eget, viverra semper ipsum. Suspendisse vel aliquam lorem. Aliquam nec dui ex. Phasellus tristique, neque sed fringilla congue, nisl ipsum hendrerit quam, suscipit laoreet sem lectus ac turpis. Donec rhoncus convallis dapibus. Sed ac dolor eget neque malesuada condimentum id commodo mauris. Maecenas aliquet massa sed magna porttitor feugiat non a ex.
Nam interdum, ex eget elementum efficitur, lorem urna hendrerit nisl, vitae iaculis ante mauris ut diam. Cras diam ex, aliquet aliquam tristique a, egestas lacinia massa. Aenean et velit vel metus varius porttitor. Vestibulum non sodales velit. Vivamus condimentum justo nec lectus aliquet interdum. Suspendisse in tempus orci, ac interdum nulla. Etiam id tincidunt lacus. Duis commodo ornare lectus, at efficitur turpis tempor sit amet.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus aliquam nisi vitae enim ultricies, quis tempor massa sodales. Donec eleifend ligula ipsum, vitae tristique turpis tincidunt at. Nam eleifend semper justo. Aliquam tempor gravida ex id luctus. Donec ante sapien, imperdiet vitae fringilla at, viverra vel nulla. Duis augue est, blandit eget turpis nec, faucibus placerat metus. Nulla sagittis elit nibh, vel rhoncus augue lacinia sed. Vivamus vitae orci vestibulum magna dignissim commodo sit amet aliquet nulla. Fusce posuere faucibus magna, pulvinar blandit enim dignissim sit amet. Nulla elementum nisl eget diam venenatis cursus ac quis elit. Aliquam facilisis sodales eleifend. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Suspendisse ullamcorper nulla in libero auctor, sit amet dignissim neque pharetra. Nunc vitae gravida ex. Etiam sem orci, elementum id fringilla a, egestas a lacus. Integer ante lorem, rhoncus in purus sit amet, mollis faucibus elit. Pellentesque eget ex quis dui tincidunt mattis tempus sed quam. Praesent ac vulputate velit. Aliquam erat volutpat.
Maecenas lacinia ex ut ligula tempus sollicitudin. Nulla facilisi. Donec lacus neque, porttitor eu tellus tincidunt, varius vestibulum augue. Praesent nec aliquet erat, a cursus sem. In quis turpis et ligula rhoncus tristique. Aenean scelerisque dui non metus sagittis efficitur. Vestibulum auctor sapien faucibus est ullamcorper convallis. Nullam fringilla purus sit amet rutrum sollicitudin. Nulla at ante egestas sapien scelerisque iaculis ut id dui. Nunc sagittis sapien nunc, quis iaculis eros luctus vitae. Integer a enim vitae nunc pellentesque tincidunt sit amet eget odio. Etiam vel leo a mi ultricies faucibus sit amet in purus. In fringilla convallis vehicula. Etiam dignissim semper commodo. Quisque euismod sodales rhoncus. Sed dapibus lacinia cursus.
Sed volutpat lectus nec mauris faucibus varius vel id ante. Sed dictum felis id mi porttitor mattis. Aenean in bibendum risus. Integer massa turpis, venenatis in odio eget, viverra semper ipsum. Suspendisse vel aliquam lorem. Aliquam nec dui ex. Phasellus tristique, neque sed fringilla congue, nisl ipsum hendrerit quam, suscipit laoreet sem lectus ac turpis. Donec rhoncus convallis dapibus. Sed ac dolor eget neque malesuada condimentum id commodo mauris. Maecenas aliquet massa sed magna porttitor feugiat non a ex.
Nam interdum, ex eget elementum efficitur, lorem urna hendrerit nisl, vitae iaculis ante mauris ut diam. Cras diam ex, aliquet aliquam tristique a, egestas lacinia massa. Aenean et velit vel metus varius porttitor. Vestibulum non sodales velit. Vivamus condimentum justo nec lectus aliquet interdum. Suspendisse in tempus orci, ac interdum nulla. Etiam id tincidunt lacus. Duis commodo ornare lectus, at efficitur turpis tempor sit amet.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus aliquam nisi vitae enim ultricies, quis tempor massa sodales. Donec eleifend ligula ipsum, vitae tristique turpis tincidunt at. Nam eleifend semper justo. Aliquam tempor gravida ex id luctus. Donec ante sapien, imperdiet vitae fringilla at, viverra vel nulla. Duis augue est, blandit eget turpis nec, faucibus placerat metus. Nulla sagittis elit nibh, vel rhoncus augue lacinia sed. Vivamus vitae orci vestibulum magna dignissim commodo sit amet aliquet nulla. Fusce posuere faucibus magna, pulvinar blandit enim dignissim sit amet. Nulla elementum nisl eget diam venenatis cursus ac quis elit. Aliquam facilisis sodales eleifend. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Suspendisse ullamcorper nulla in libero auctor, sit amet dignissim neque pharetra. Nunc vitae gravida ex. Etiam sem orci, elementum id fringilla a, egestas a lacus. Integer ante lorem, rhoncus in purus sit amet, mollis faucibus elit. Pellentesque eget ex quis dui tincidunt mattis tempus sed quam. Praesent ac vulputate velit. Aliquam erat volutpat.
Maecenas lacinia ex ut ligula tempus sollicitudin. Nulla facilisi. Donec lacus neque, porttitor eu tellus tincidunt, varius vestibulum augue. Praesent nec aliquet erat, a cursus sem. In quis turpis et ligula rhoncus tristique. Aenean scelerisque dui non metus sagittis efficitur. Vestibulum auctor sapien faucibus est ullamcorper convallis. Nullam fringilla purus sit amet rutrum sollicitudin. Nulla at ante egestas sapien scelerisque iaculis ut id dui. Nunc sagittis sapien nunc, quis iaculis eros luctus vitae. Integer a enim vitae nunc pellentesque tincidunt sit amet eget odio. Etiam vel leo a mi ultricies faucibus sit amet in purus. In fringilla convallis vehicula. Etiam dignissim semper commodo. Quisque euismod sodales rhoncus. Sed dapibus lacinia cursus.
Sed volutpat lectus nec mauris faucibus varius vel id ante. Sed dictum felis id mi porttitor mattis. Aenean in bibendum risus. Integer massa turpis, venenatis in odio eget, viverra semper ipsum. Suspendisse vel aliquam lorem. Aliquam nec dui ex. Phasellus tristique, neque sed fringilla congue, nisl ipsum hendrerit quam, suscipit laoreet sem lectus ac turpis. Donec rhoncus convallis dapibus. Sed ac dolor eget neque malesuada condimentum id commodo mauris. Maecenas aliquet massa sed magna porttitor feugiat non a ex.
Nam interdum, ex eget elementum efficitur, lorem urna hendrerit nisl, vitae iaculis ante mauris ut diam. Cras diam ex, aliquet aliquam tristique a, egestas lacinia massa. Aenean et velit vel metus varius porttitor. Vestibulum non sodales velit. Vivamus condimentum justo nec lectus aliquet interdum. Suspendisse in tempus orci, ac interdum nulla. Etiam id tincidunt lacus. Duis commodo ornare lectus, at efficitur turpis tempor sit amet.
</body>
</html>

Просмотреть файл

@ -0,0 +1,6 @@
FROM opensuse/leap:15 AS build
ARG package_name
COPY ./tmp/$package_name .
RUN zypper --no-gpg-checks --non-interactive install -y ./$package_name
RUN zypper --non-interactive install -y wget

Просмотреть файл

@ -2,4 +2,6 @@ FROM opensuse/leap:15 AS build
ARG package_name
COPY ./tmp/$package_name .
RUN zypper --no-gpg-checks --non-interactive install -y ./$package_name
RUN zypper --non-interactive install -y netcat-openbsd findutils
RUN zypper --non-interactive install -y nginx
COPY index.html /srv/www/htdocs/

3
test/nginx/run_client.sh Normal file
Просмотреть файл

@ -0,0 +1,3 @@
/usr/share/azbridge/azbridge -v -l /tests/clientlog.log -x $AZBRIDGE_TEST_CXNSTRING -L 127.0.9.1:8088/test:a1 &
sleep 5
wget -O /tests/downloaded.txt http://127.0.9.1:8088

3
test/nginx/run_nginx.sh Normal file
Просмотреть файл

@ -0,0 +1,3 @@
/usr/share/azbridge/azbridge -v -l /tests/applog.log -x $AZBRIDGE_TEST_CXNSTRING -R a1:test/80 &
sleep 5
nginx -g 'daemon off;'

90
test/nginx/test.cmd Normal file
Просмотреть файл

@ -0,0 +1,90 @@
rem @echo off
echo %~1 %~2 %~3 %~4 %~5 %~6
if not "%~1" == "" set Operation=%~1
if not "%~2" == "" set ImageName=%~2
if not "%~3" == "" set ImageSuffix=%~3
if not "%~4" == "" set VersionPrefix=%~4
if not "%~5" == "" set VersionSuffix=%~5
if not "%~6" == "" set TargetFramework=%~6
if "%Operation%"=="" set Operation=build
if "%ImageName%"=="" set ImageName=ubuntu.18.04-x64
if "%ImageSuffix%"=="" set ImageSuffix=deb
if "%VersionSuffix%"=="" set VersionSuffix=preview
if "%VersionPrefix%"=="" set VersionPrefix=1.0.0
if "%TargetFramework%"=="" set TargetFramework=netcoreapp3.0
pushd "%~dp0"
set PackageName=azbridge.%VersionPrefix%-%VersionSuffix%.%ImageName%.%ImageSuffix%
set _MOUNTPATH=%cd%
if "%Operation%"=="build" (
if NOT exist ..\..\artifacts\build\%TargetFramework%\%PackageName% (
echo Cannot find ..\..\artifacts\build\%TargetFramework%\%PackageName%
exit 2
)
if not exist "tmp" mkdir tmp
copy /y ..\..\artifacts\build\%TargetFramework%\%PackageName% tmp > NUL
docker build -f %ImageName%.server.dockerfile . --tag azbridge-nginx-server-%ImageName% --build-arg package_name=%PackageName%
docker build -f %ImageName%.client.dockerfile . --tag azbridge-nginx-client-%ImageName% --build-arg package_name=%PackageName%
rd /s /q tmp
popd
exit /b
)
if "%Operation%"=="test" (
goto test
)
if "%Operation%"=="clean" (
goto clean
)
else (
echo "Unknown operation"
popd
)
exit
:test
if '%AZBRIDGE_TEST_CXNSTRING%' == "" (
echo AZBRIDGE_TEST_CXNSTRING environment variable must be set to valid relay connection string
exit /b
)
rem start the web server
docker run -v %_MOUNTPATH%:/tests --rm -d -e AZBRIDGE_TEST_CXNSTRING=%AZBRIDGE_TEST_CXNSTRING% azbridge-nginx-server-%ImageName%:latest bash /tests/run_nginx.sh > srvrun.log
for /f %%i in ( srvrun.log ) do set _SERVER_NAME=%%i
rem run the client
docker run -v %_MOUNTPATH%:/tests --rm -e AZBRIDGE_TEST_CXNSTRING=%AZBRIDGE_TEST_CXNSTRING% azbridge-nginx-client-%ImageName%:latest bash /tests/run_client.sh
rem stop the web server
docker stop %_SERVER_NAME%
fc /L downloaded.txt index.html > NUL
if ERRORLEVEL 1 (
set _RESULT=%ERRORLEVEL%
echo Error %_RESULT%
)
if ERRORLEVEL 0 (
set _RESULT=0
echo OK
)
popd
exit _RESULT
:clean
set IMAGE_NAME=%ImageName%
for /f %%i in ('docker images azbridge-nginx-server-%IMAGE_NAME% -q') do set _IMAGE_ID=%%i
if "%_IMAGE_ID%"=="" exit /b
docker rmi -f azbridge-nginx-server-%ImageName%:latest
for /f %%i in ('docker images azbridge-nginx-client-%IMAGE_NAME% -q') do set _IMAGE_ID=%%i
if "%_IMAGE_ID%"=="" exit /b
docker rmi -f azbridge-nginx-client-%ImageName%:latest
popd

81
test/nginx/test.sh Normal file
Просмотреть файл

@ -0,0 +1,81 @@
#!/bin/bash
if [ ! -z $1 ]; then Operation=$1; fi
if [ ! -z $2 ]; then ImageName=$2; fi
if [ ! -z $3 ]; then ImageSuffix=$3; fi
if [ ! -z $4 ]; then VersionPrefix=$4; fi
if [ ! -z $5 ]; then VersionSuffix=$5; fi
if [ ! -z $6 ]; then TargetFramework=$6; fi
if [ -z ${Operation+x} ]; then Operation='build'; fi
if [ -z ${ImageName+x} ]; then ImageName='ubuntu.18.04-x64'; fi
if [ -z ${ImageSuffix+x} ]; then VersionSuffix='deb'; fi
if [ -z ${VersionSuffix+x} ]; then VersionSuffix='preview'; fi
if [ -z ${VersionPrefix+x} ]; then VersionPrefix='1.0.0'; fi
if [ -z ${TargetFramework+x} ]; then TargetFramework='netcoreapp3.0'; fi
echo $@
PackageName=azbridge.$VersionPrefix-$VersionSuffix.$ImageName.$ImageSuffix
if [ "${Operation}" == "build" ]; then
pushd "${0%/*}" > /dev/null
if [ ! -d "tmp" ]; then mkdir tmp; fi
cp ../../artifacts/build/$TargetFramework/$PackageName tmp/ > /dev/null
docker build -f $ImageName.server.dockerfile . --tag azbridge-nginx-server-$ImageName --build-arg package_name=$PackageName
_RESULT=$?
if [ $_RESULT -ne 0 ]; then
rm -rf tmp
popd
exit $_RESULT
fi
docker build -f $ImageName.client.dockerfile . --tag azbridge-nginx-client-$ImageName --build-arg package_name=$PackageName
_RESULT=$?
if [ $_RESULT -ne 0 ]; then
rm -rf tmp
popd
exit $_RESULT
fi
rm -rf tmp
popd
else
if [ "${Operation}" == "test" ]; then
pushd "${0%/*}" > /dev/null
IMAGE_NAME=$PackageName
_CXNSTRING=$AZBRIDGE_TEST_CXNSTRING
if [ -z $_CXNSTRING ]; then
echo AZBRIDGE_TEST_CXNSTRING environment variable must be set to valid relay connection string
exit
fi
# start the web server
server_name=$(docker run -v $(pwd):/tests --rm -d -e AZBRIDGE_TEST_CXNSTRING="$_CXNSTRING" azbridge-nginx-server-$ImageName:latest bash /tests/run_nginx.sh)
# run the client
docker run -v $(pwd):/tests --rm -e AZBRIDGE_TEST_CXNSTRING="$_CXNSTRING" azbridge-nginx-client-$ImageName:latest bash /tests/run_client.sh
# stop the web server
docker stop $server_name
diff --strip-trailing-cr -B -i -w downloaded.txt index.html
_RESULT=$?
rm downloaded.txt
if [ $_RESULT -eq 0 ]; then
echo OK
exit 0
else
echo not ok
exit 1
fi
else
if [ "${Operation}" == "clean" ]; then
if [ ! -z `docker images "azbridge-nginx-server-$ImageName" -q` ]; then
docker rmi -f azbridge-nginx-server-$ImageName:latest
fi
if [ ! -z `docker images "azbridge-nginx-client-$ImageName" -q` ]; then
docker rmi -f azbridge-nginx-client-$ImageName:latest
fi
else
echo "Unknown command"
fi
fi
fi

Просмотреть файл

@ -2,5 +2,5 @@ FROM ubuntu:18.04 AS build
ARG package_name
COPY ./tmp/$package_name .
RUN apt-get update -y
RUN apt-get install -y ./$package_name netcat-openbsd findutils
RUN apt-get install -y ./$package_name wget

Просмотреть файл

@ -0,0 +1,7 @@
FROM ubuntu:18.04 AS build
ARG package_name
COPY ./tmp/$package_name .
RUN apt-get update -y
RUN apt-get install -y ./$package_name nginx
COPY index.html /var/www/html

5
test/relay_cleanup.sh Normal file
Просмотреть файл

@ -0,0 +1,5 @@
if [ ! -z $1 ]; then ResourceGroup=$1; fi
if [ -z ${ResourceGroup+x} ]; then ResourceGroup=$AZBRIDGE_TEST_RESOURCEGROUP; fi
az group delete --name $ResourceGroup --yes

20
test/relay_setup.sh Normal file
Просмотреть файл

@ -0,0 +1,20 @@
if [ ! -z $1 ]; then Region=$1; fi
if [ ! -z $2 ]; then ResourceGroup=$2; fi
if [ ! -z $3 ]; then Namespace=$3; fi
d=$(date +%Y%m%d%H%M%S)
if [ -z ${Region+x} ]; then Region='westeurope'; fi
if [ -z ${ResourceGroup+x} ]; then ResourceGroup='azbridge'$d; fi
if [ -z ${Namespace+x} ]; then Namespace=$ResourceGroup; fi
echo $ResourceGroup
az group create --name $ResourceGroup --location $Region
az relay namespace create --resource-group $ResourceGroup --name $Namespace
az relay namespace authorization-rule create --resource-group $ResourceGroup --namespace-name $Namespace --name SendListen --rights Send Listen
az relay hyco create --resource-group $ResourceGroup --namespace-name $Namespace --name a1
az relay hyco create --resource-group $ResourceGroup --namespace-name $Namespace --name a2
export AZBRIDGE_TEST_CXNSTRING=$(az relay namespace authorization-rule keys list --resource-group $ResourceGroup --namespace-name $Namespace --name SendListen --query 'primaryConnectionString' -o json)
export AZBRIDGE_TEST_RESOURCEGROUP=$ResourceGroup
export AZBRIDGE_TEST_NAMESPACE=$Namespace

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -5,6 +5,10 @@ where %xunitrunner% 2>&1
if ERRORLEVEL 1 set xunitrunner=C:\Tools\xUnit20\xunit.console.exe
"%xunitrunner%" "test\unit\Microsoft.Azure.Relay.Bridge.Tests\bin\Debug\net462\Microsoft.Azure.Relay.Bridge.Tests.dll" -appveyor
rem cd test\docker
rem cd test\nginx
rem msbuild /t:clean,build,vstest
rem popd

Просмотреть файл

@ -3,7 +3,13 @@
if [ ! -z $APPVEYOR_BUILD_VERSION ]; then _VersionProp="/p:VersionPrefix=$APPVEYOR_BUILD_VERSION"; fi
dotnet test --verbosity=normal /p:SelfContained=false
#cd test/docker
#dotnet clean --verbosity=normal /p:Configuration=Debug /p:TargetFramework=netcoreapp3.0 $_BuildProp $_VersionProp $@
#dotnet build --verbosity=normal /p:Configuration=Debug /p:TargetFramework=netcoreapp3.0 $_BuildProp $_VersionProp $@
#dotnet test --verbosity=normal /p:Configuration=Debug /p:TargetFramework=netcoreapp3.0 $_BuildProp $_VersionProp $@
pushd test/mysql
dotnet clean --verbosity=normal /p:Configuration=Debug /p:TargetFramework=netcoreapp3.0 $_BuildProp $_VersionProp $@
dotnet msbuild /t:build --verbosity=normal /p:Configuration=Debug /p:TargetFramework=netcoreapp3.0 $_BuildProp $_VersionProp $@
dotnet test --verbosity=normal /p:Configuration=Debug /p:TargetFramework=netcoreapp3.0 $_BuildProp $_VersionProp $@
popd
pushd test/nginx
dotnet clean --verbosity=normal /p:Configuration=Debug /p:TargetFramework=netcoreapp3.0 $_BuildProp $_VersionProp $@
dotnet msbuild /t:build --verbosity=normal /p:Configuration=Debug /p:TargetFramework=netcoreapp3.0 $_BuildProp $_VersionProp $@
dotnet test --verbosity=normal /p:Configuration=Debug /p:TargetFramework=netcoreapp3.0 $_BuildProp $_VersionProp $@
popd