예제 #1
0
        protected async Task OneTimeSetUp()
        {
            // make sure all servers started in travis use a different port, or test will fail
            int testPort = 50000 + (((Int32)DateTime.UtcNow.ToFileTimeUtc() / 10000) & 0x1fff);

            _serverCapabilities = new ServerCapabilities();
            _randomSource       = new RandomSource(randomStart);
            _dataGenerator      = new DataGenerator(_randomSource);
            _server             = new GlobalDiscoveryTestServer(true);
            await _server.StartServer(true, testPort);

            await Task.Delay(1000);

            // load clients
            _gdsClient = new GlobalDiscoveryTestClient(true);
            await _gdsClient.LoadClientConfiguration(testPort);

            _pushClient = new ServerConfigurationPushTestClient(true);
            await _pushClient.LoadClientConfiguration(testPort);

            // connect once
            await _gdsClient.GDSClient.Connect(_gdsClient.GDSClient.EndpointUrl);

            await _pushClient.PushClient.Connect(_pushClient.PushClient.EndpointUrl);

            ConnectGDSClient(true);
            RegisterPushServerApplication(_pushClient.PushClient.EndpointUrl);

            _selfSignedServerCert = new X509Certificate2(_pushClient.PushClient.Session.ConfiguredEndpoint.Description.ServerCertificate);
            _domainNames          = Utils.GetDomainsFromCertficate(_selfSignedServerCert).ToArray();

            CreateCATestCerts(_pushClient.TempStorePath);
        }
예제 #2
0
        protected async Task OneTimeSetUp()
        {
            // start GDS first clean, then restart server
            // to ensure the application cert is not 'fresh'
            _server = await TestUtils.StartGDS(true);

            _server.StopServer();
            await Task.Delay(1000);

            _server = await TestUtils.StartGDS(false);

            _serverCapabilities = new ServerCapabilities();
            _randomSource       = new RandomSource(randomStart);
            _dataGenerator      = new DataGenerator(_randomSource);

            // load clients
            _gdsClient = new GlobalDiscoveryTestClient(true);
            await _gdsClient.LoadClientConfiguration(_server.BasePort);

            _pushClient = new ServerConfigurationPushTestClient(true);
            await _pushClient.LoadClientConfiguration(_server.BasePort);

            // connect once
            await _gdsClient.GDSClient.Connect(_gdsClient.GDSClient.EndpointUrl);

            await _pushClient.PushClient.Connect(_pushClient.PushClient.EndpointUrl);

            ConnectGDSClient(true);
            RegisterPushServerApplication(_pushClient.PushClient.EndpointUrl);

            _selfSignedServerCert = new X509Certificate2(_pushClient.PushClient.Session.ConfiguredEndpoint.Description.ServerCertificate);
            _domainNames          = X509Utils.GetDomainsFromCertficate(_selfSignedServerCert).ToArray();

            await CreateCATestCerts(_pushClient.TempStorePath);
        }
예제 #3
0
        protected async Task OneTimeSetUp()
        {
            // start GDS
            _server = await TestUtils.StartGDS(true).ConfigureAwait(false);

            // load client
            _gdsClient = new GlobalDiscoveryTestClient(true);
            await _gdsClient.LoadClientConfiguration(_server.BasePort).ConfigureAwait(false);

            // good applications test set
            _appTestDataGenerator      = new ApplicationTestDataGenerator(1);
            _goodApplicationTestSet    = _appTestDataGenerator.ApplicationTestSet(goodApplicationsTestCount, false);
            _invalidApplicationTestSet = _appTestDataGenerator.ApplicationTestSet(invalidApplicationsTestCount, true);

            _goodRegistrationOk      = false;
            _invalidRegistrationOk   = false;
            _goodNewKeyPairRequestOk = false;
        }
예제 #4
0
        protected void OneTimeSetUp()
        {
            // work around travis issue by selecting different ports on every run
            int testPort = 50000 + (((Int32)DateTime.UtcNow.ToFileTimeUtc() / 10000) & 0x1fff);

            _server = new GlobalDiscoveryTestServer(true);
            _server.StartServer(true, testPort).Wait();

            // load client
            _gdsClient = new GlobalDiscoveryTestClient(true);
            _gdsClient.LoadClientConfiguration(testPort).Wait();

            // good applications test set
            _appTestDataGenerator      = new ApplicationTestDataGenerator(1);
            _goodApplicationTestSet    = _appTestDataGenerator.ApplicationTestSet(goodApplicationsTestCount, false);
            _invalidApplicationTestSet = _appTestDataGenerator.ApplicationTestSet(invalidApplicationsTestCount, true);

            _goodRegistrationOk      = false;
            _invalidRegistrationOk   = false;
            _goodNewKeyPairRequestOk = false;
        }