コード例 #1
0
        public void EnvironmentVariable__NEWRELIC_LICENSEKEY()
        {
            var installTestApp = new TestApplication(application: Applications.DotNet_Functional_InstallTestApp);

            installTestApp.TServer.CreateEnvironmentVariable("NEWRELIC_LICENSEKEY", Settings.LicenseKey);
            installTestApp.TServer.CommandLineInstall(licenseKey: null, allFeatures: true, testName: nameof(EnvironmentVariable__NEWRELIC_LICENSEKEY));
            ComponentManager.TruncateComponents(_tServer);

            installTestApp.TServer.ModInstallAppWebConfigXML(true);
            installTestApp.TServer.IISCommand("Start");
            installTestApp.SimpleTestRequest(resource: "service/start");
            installTestApp.WaitForLog(TestApplication.LogEntry.fullyConnected);
            installTestApp.TServer.IISCommand("Stop");

            var expected = String.Format(" Reporting to: https://staging.newrelic.com/accounts/{0}/applications/", Common.StagingAccountId);

            Assert.IsTrue(installTestApp.AgentLog.Contains(expected), "Agent is not connected.");
        }
コード例 #2
0
        public void LogsFolderReCreatedWhenDeleted()
        {
            var installTestApp = new TestApplication(application: Applications.DotNet_Functional_InstallTestApp);

            installTestApp.TServer.CommandLineInstall(licenseKey: Settings.LicenseKey, testName: nameof(LogsFolderReCreatedWhenDeleted));
            ComponentManager.TruncateComponents(_tServer);

            installTestApp.TServer.ModifyOrCreateXmlAttribute("//x:configuration", "agentEnabled", "true");
            installTestApp.TServer.ModInstallAppWebConfigXML(true);

            // Start the service, let run, stop the service
            installTestApp.TServer.IISCommand("Start");
            installTestApp.SimpleTestRequest(resource: "service/start");
            installTestApp.WaitForLog(TestApplication.LogEntry.fullyConnected);
            installTestApp.TServer.IISCommand("Stop");

            Assert.IsTrue(FileOperations.FileOrDirectoryExists(_tServer.MgmtScope, @"C:\\ProgramData\\New Relic\\.NET Agent\\Logs", true), "Logs folder was not recreated.");
        }
コード例 #3
0
        public void NewRelicAgentEnabledFalse_ProfilerNotLoaded()
        {
            var installTestApp = new TestApplication(application: Applications.DotNet_Functional_InstallTestApp);

            TServer.IISCommand("Stop");
            TServer.PurgeAgentLogs();

            TServer.ModifyOrCreateXmlAttribute("//x:configuration", "agentEnabled", "false");
            TServer.ModInstallAppWebConfigXML(agentEnabled: true);

            // Start the service, let run for 5 seconds
            TServer.IISCommand("Start");
            installTestApp.SimpleTestRequest(resource: "service/start");
            Thread.Sleep(5000);

            // Verify the 'NewRelic.Profiler' is NOT loaded
            Assert.IsFalse(Common.FileLoadedInProcess(TServer.MgmtScope, "NewRelic.Profiler", "w3wp.exe"));
            TServer.IISCommand("Stop");
        }
コード例 #4
0
        public void AgentEnabledTrue_ILLoaded()
        {
            var installTestApp = new TestApplication(application: Applications.DotNet_Functional_InstallTestApp);

            TServer.IISCommand("Stop");
            TServer.PurgeAgentLogs();

            TServer.ModifyOrCreateXmlAttribute("//x:configuration", "agentEnabled", "true");
            TServer.ModInstallAppWebConfigXML(agentEnabled: true);

            // Start the service, wait for logging to occur
            TServer.IISCommand("Start");
            installTestApp.SimpleTestRequest(resource: "service/start");
            installTestApp.WaitForLog(TestApplication.LogEntry.fullyConnected);

            // Verify the 'NewRelic.Profiler' is loaded, stop the service
            Assert.IsTrue(Common.FileLoadedInProcess(TServer.MgmtScope, "NewRelic.Profiler", "w3wp.exe"));
            TServer.IISCommand("Stop");
        }
コード例 #5
0
        public void EnvironmentVariable__NEW_RELIC_HOST()
        {
            var installTestApp = new TestApplication(application: Applications.DotNet_Functional_InstallTestApp);

            installTestApp.TServer.CreateEnvironmentVariable("NEW_RELIC_HOST", "staging-collector.newrelic.com");
            installTestApp.TServer.CommandLineInstall(licenseKey: Settings.LicenseKey, setCollectorHost: false, testName: nameof(EnvironmentVariable__NEW_RELIC_HOST));
            ComponentManager.TruncateComponents(_tServer);

            installTestApp.TServer.ModInstallAppWebConfigXML(true);
            installTestApp.TServer.IISCommand("Start");
            installTestApp.SimpleTestRequest(resource: "service/start");
            installTestApp.WaitForLog(TestApplication.LogEntry.fullyConnected);
            installTestApp.TServer.IISCommand("Stop");

            var expectedLogMessageConnected = String.Format(" Reporting to: https://staging.newrelic.com/accounts/{0}/applications/", installTestApp.AccountId);

            Assert.IsTrue(installTestApp.AgentLog.Contains(expectedLogMessageConnected), "Application is not connected.");
            Assert.IsTrue(Regex.IsMatch(installTestApp.AgentLog, " Received : {\"return_value\":{\"redirect_host\":\"staging-collector-[0-9]+\\.newrelic\\.com\"}}"), "Did not receive a successful response from the collector proxy.");
        }
コード例 #6
0
        public void AgentEnabledFalse_NewRelicCoreNotLoaded()
        {
            var installTestApp = new TestApplication(application: Applications.DotNet_Functional_InstallTestApp);

            TServer.IISCommand("Stop");
            TServer.PurgeAgentLogs();

            TServer.ModifyOrCreateXmlAttribute("//x:configuration", "agentEnabled", "true");
            TServer.ModInstallAppWebConfigXML(agentEnabled: false);

            // Start the service, let run for 5 seconds
            TServer.IISCommand("Start");
            installTestApp.SimpleTestRequest(resource: "service/start");
            Thread.Sleep(5000);

            // Verify the 'NewRelic.Core' is NOT loaded
            //Web apps load and keep the profiler, agent.core, and extensions in the scenario.  Console apps drop everything.
            Assert.IsFalse(Common.FileLoadedInProcess(TServer.MgmtScope, "NewRelic.Core", "w3wp.exe"));
            TServer.IISCommand("Stop");
        }