示例#1
0
        public async Task OneTimeSetUpAsync()
        {
            // this test fails on macOS, ignore (TODO)
            if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
            {
                Assert.Ignore("Reverse connect fails on mac OS.");
            }

            // pki directory root for test runs.
            PkiRoot = Path.GetTempPath() + Path.GetRandomFileName();

            // start ref server with reverse connect
            ServerFixture = new ServerFixture <ReferenceServer> {
                AutoAccept            = true,
                SecurityNone          = true,
                ReverseConnectTimeout = MaxTimeout,
                TraceMasks            = Utils.TraceMasks.Error | Utils.TraceMasks.Security
            };
            ReferenceServer = await ServerFixture.StartAsync(TestContext.Out, PkiRoot).ConfigureAwait(false);

            // create client
            ClientFixture = new ClientFixture();
            await ClientFixture.LoadClientConfiguration(PkiRoot).ConfigureAwait(false);

            await ClientFixture.StartReverseConnectHost().ConfigureAwait(false);

            m_endpointUrl = new Uri(Utils.ReplaceLocalhost("opc.tcp://localhost:" + ServerFixture.Port.ToString()));
            // start reverse connection
            ReferenceServer.AddReverseConnection(new Uri(ClientFixture.ReverseConnectUri), MaxTimeout);
        }
        public async Task OneTimeSetUpAsync()
        {
            // this test fails on macOS, ignore
            if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
            {
                Assert.Ignore("Reverse connect fails on mac OS.");
            }

            // start ref server
            m_serverFixture = new ServerFixture <ReferenceServer> {
                AutoAccept            = true,
                SecurityNone          = true,
                ReverseConnectTimeout = MaxTimeout,
                TraceMasks            = Utils.TraceMasks.Error | Utils.TraceMasks.Security
            };
            m_server = await m_serverFixture.StartAsync(TestContext.Out).ConfigureAwait(false);

            // create client
            m_clientFixture = new ClientFixture();
            await m_clientFixture.LoadClientConfiguration().ConfigureAwait(false);

            await m_clientFixture.StartReverseConnectHost().ConfigureAwait(false);

            m_endpointUrl = new Uri(Utils.ReplaceLocalhost("opc.tcp://localhost:" + m_serverFixture.Port.ToString()));
            // start reverse connection
            m_server.AddReverseConnection(new Uri(m_clientFixture.ReverseConnectUri), MaxTimeout);
        }