/// <summary> /// Runs the test. /// </summary> public override bool Run(ServerTestCase testcase, int iteration) { Iteration = iteration; // need fetch nodes used for the test if not already available. if (AvailableNodes.Count == 0) { if (!GetNodesInHierarchy()) { return false; } } // do secondary test. switch (testcase.Name) { case "MultiHop": { return DoMultiHopTest(3); } default: { return DoMultiHopTest(0); } } }
/// <summary> /// Runs the test for all of the browse roots. /// </summary> public override bool Run(ServerTestCase testcase, int iteration) { try { LockServer(); Iteration = iteration; if (ReadOnlyTests) { Log("WARNING: TestCase {0} skipped because client could not acquire a lock on the Server.", testcase.Name); return true; } // need fetch nodes used for the test if not already available. if (AvailableNodes.Count == 0) { if (!GetNodesInHierarchy()) { return false; } } // get the writeable variables. if (WriteableVariables.Count == 0) { if (!GetWriteableVariablesInHierarchy()) { Log("WARNING: No writeable variables found."); Log(g_WriteableVariableHelpText); return true; } } // do secondary test. switch (testcase.Name) { case "TypeMismatch": { return DoWriteBadTypeTest(); } default: { return DoWriteTest(); } } } finally { UnlockServer(); } }
/// <summary> /// Runs the test for all of the browse roots. /// </summary> public override bool Run(ServerTestCase testcase, int iteration) { Iteration = iteration; // always re-fetch for Hierarchical test. if (testcase.Name == "Hierarchical") { AvailableNodes.Clear(); } // need fetch nodes used for the test if not already available. if (AvailableNodes.Count == 0) { if (!GetNodesInHierarchy()) { return false; } } // do secondary test. switch (testcase.Name) { case "ReferenceType": { return DoReferenceTypeTest(); } case "NodeClass": { return DoNodeClassTest(); } case "BrowseResultMask": { return DoBrowseResultMaskTest(); } case "BrowseNext": { return DoBrowseNextTest(); } } return true; }
/// <summary> /// Runs the test /// </summary> public override bool Run(ServerTestCase testcase, int iteration) { Iteration = iteration; // do secondary test. switch (testcase.Name) { case "PublishingInterval": { if (!DoPublishingIntervalTest()) { Log("WARNING: Re-doing PublishingInterval test to check if random timing glitches were the cause of failure."); return DoPublishingIntervalTest(); } return true; } case "CreateItems": { // need fetch nodes used for the test if not already available. if (AvailableNodes.Count == 0) { if (!GetNodesInHierarchy()) { return false; } } return DoCreateItemsTest(); } default: { if (!DoKeepAliveTest()) { Log("WARNING: Re-doing KeepAlive test to check if random timing glitches were the cause of failure."); return DoKeepAliveTest(); } return true; } } }
/// <summary> /// Runs the test for all of the browse roots. /// </summary> public override bool Run(ServerTestCase testcase, int iteration) { Iteration = iteration; // do secondary test. switch (testcase.Name) { case "KeepAlive": { return DoKeepAliveTest(); } default: case "Reconnect": { return DoReconnectTest(); } } }
/// <summary> /// Runs the test case. /// </summary> public virtual bool Run(ServerTestCase testcase, int iteration) { return true; }
/// <summary> /// Runs the test for all of the browse roots. /// </summary> public override bool Run(ServerTestCase testcase, int iteration) { try { LockServer(); if (ReadOnlyTests) { Log("WARNING: TestCase {0} skipped because client could not acquire a lock on the Server.", testcase.Name); return true; } Iteration = iteration; // need fetch nodes used for the test if not already available. if (AvailableNodes.Count == 0) { if (!GetNodesInHierarchy()) { return false; } } // get the writeable variables. if (WriteableVariables.Count == 0) { if (!GetWriteableVariablesInHierarchy()) { Log("WARNING: No writeable variables found."); Log(WriteTest.g_WriteableVariableHelpText); return true; } } // do main test. NotificationEventHandler handler = new NotificationEventHandler(Session_Notification); try { Session.Notification += handler; bool result = true; switch (testcase.Name) { case "Deadband": { if (!DoDeadbandTest(false)) { Log("WARNING: Re-doing Deadband test to check if random timing glitches were the cause of failure."); result = DoDeadbandTest(false); break; } return true; } case "ModifyDeadband": { if (!DoDeadbandTest(true)) { Log("WARNING: Re-doing ModifyDeadband test to check if random timing glitches were the cause of failure."); result = DoDeadbandTest(true); break; } return true; } case "QueueSize": { if (!DoQueueSizeTest(false)) { Log("WARNING: Re-doing QueueSize test to check if random timing glitches were the cause of failure."); result = DoQueueSizeTest(false); break; } return true; } case "ModifyQueueSize": { if (!DoQueueSizeTest(true)) { Log("WARNING: Re-doing ModifyQueueSize test to check if random timing glitches were the cause of failure."); result = DoQueueSizeTest(true); break; } return true; } case "ModifySamplingInterval": { if (!DoSamplingIntervalTest(true)) { Log("WARNING: Re-doing ModifySamplingInterval test to check if random timing glitches were the cause of failure."); result = DoSamplingIntervalTest(true); break; } return true; } default: { if (!DoSamplingIntervalTest(true)) { Log("WARNING: Re-doing SamplingInterval test to check if random timing glitches were the cause of failure."); result = DoSamplingIntervalTest(false); break; } return true; } } if (!result && m_writeDelayed) { Log("WARNING: Test skipped because the system is likely overloaded and cannot process the requests fast enough."); result = true; } return result; } finally { Session.Notification -= handler; } } finally { UnlockServer(); } }
/// <summary> /// Loads the configuration from a file on disk. /// </summary> public static ServerTestConfiguration Load(string filePath, ServerTestConfiguration masterConfiguration) { XmlTextReader reader = new XmlTextReader(filePath); try { DataContractSerializer serializer = new DataContractSerializer(typeof(ServerTestConfiguration)); ServerTestConfiguration configuration = serializer.ReadObject(reader) as ServerTestConfiguration; configuration.m_filePath = filePath; if (configuration.Iterations <= 0) { configuration.Iterations = 1; } if (masterConfiguration != null) { ListOfServerTestCase replacements = new ListOfServerTestCase(); for (int ii = 0; ii < masterConfiguration.TestCases.Count; ii++) { ServerTestCase template = masterConfiguration.TestCases[ii]; // create replacement that is disabled by default. ServerTestCase replacement = new ServerTestCase(); replacement.Name = template.Name; replacement.Parent = template.Parent; replacement.Enabled = false; replacement.Breakpoint = false; replacements.Add(replacement); // load settings from saved test case. for (int jj = 0; jj < configuration.TestCases.Count; jj++) { ServerTestCase actual = configuration.TestCases[jj]; if (actual.Name == template.Name && actual.Parent == template.Parent) { replacement.Enabled = actual.Enabled; replacement.Breakpoint = actual.Breakpoint; break; } } } // replace the test cases. configuration.TestCases = replacements; } return configuration; } finally { reader.Close(); } }
/// <summary> /// Constructs the object. /// </summary> public ReportProgressEventArgs( ConfiguredEndpoint endpoint, ServerTestCase testcase, int testCount, int failedTestCount, int endpointCount, int totalEndpointCount, int iterationCount, int totalIterationCount, double currentProgress, double finalProgress, bool breakpoint) { m_endpoint = endpoint; m_testcase = testcase; m_testCount = testCount; m_failedTestCount = failedTestCount; m_endpointCount = endpointCount; m_totalEndpointCount = totalEndpointCount; m_iterationCount = iterationCount; m_totalIterationCount = totalIterationCount; m_currentProgress = currentProgress; m_finalProgress = finalProgress; m_breakpoint = breakpoint; m_stop = false; }
/// <summary> /// Constructs the object. /// </summary> public ReportResultEventArgs( ServerTestCase testcase, string format, params object[] args) { m_testcase = testcase; m_format = format; m_args = args; m_stop = false; }
/// <summary> /// Runs the test for all of the browse roots. /// </summary> public override bool Run(ServerTestCase testcase, int iteration) { Iteration = iteration; // need fetch nodes used for the test if not already available. bool fetched = false; if (AvailableNodes.Count == 0) { fetched = true; if (!GetNodesInHierarchy()) { return false; } } // do secondary test. switch (testcase.Name) { case "IndexRanges": { if (fetched) { if (!DoReadTest()) { return false; } } return DoReadIndexRangeTest(); } case "DataEncodings": { if (fetched) { if (!DoReadTest()) { return false; } } return DoReadDataEncodingTest(); } case "ReadWrite": { try { LockServer(); if (ReadOnlyTests) { Log("WARNING: TestCase {0} skipped because client could not acquire a lock on the Server.", testcase.Name); return true; } if (fetched) { if (!DoReadTest()) { return false; } } return DoReadWriteTest(); } finally { UnlockServer(); } } default: { return DoReadTest(); } } }