public void JS_PTI_RestartTwoProcKillClient_BiDi_Test() { Utilities MyUtils = new Utilities(); JS_Utilities JSUtils = new JS_Utilities(); int numRounds = 10; long totalBytes = 163840; long totalEchoBytes = 163840; int bytesPerRound = 16384; int maxMessageSize = 64; int batchSizeCutoff = 16384; int messagesSent = 2560; bool bidi = true; string testName = "jsptirestartkillclientbidi"; string clientInstanceName = testName + "client"; string serverInstanceName = testName + "server"; string logOutputClientFileName_TestApp = testName + "Client_TestApp.log"; string logOutputServerFileName_TestApp = testName + "Server_TestApp.log"; string logOutputClientRestartedFileName_TestApp = testName + "Client_TestApp_Restarted.log"; JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, testName, JSUtils.JSPTI_CombinedInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, clientInstanceName, JSUtils.JSPTI_ClientInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, serverInstanceName, JSUtils.JSPTI_ServerInstanceRole); // Start it once - Launch the client and the server as separate procs //*** NOTE - The first call (server in this case) starts 4 nodes and sometimes it doesn't give proper process id //*** However, the second call only starts one node, so make sure client is second so then know that PID is correct for killing it int serverProcessID = JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputServerFileName_TestApp, 0, false, JSUtils.JSPTI_ServerInstanceRole); int clientProcessID = JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputClientFileName_TestApp, 0, false, JSUtils.JSPTI_ClientInstanceRole, serverInstanceName); // Give it 15 seconds where it tries to connect but doesn't MyUtils.TestDelay(15000); // Kill client MyUtils.KillProcess(clientProcessID); // Restart the client and make sure it continues clientProcessID = JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputClientRestartedFileName_TestApp, 0, false, JSUtils.JSPTI_ClientInstanceRole, serverInstanceName); // Verify the data in the restarted output file bool pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "Bytes received: " + totalBytes.ToString(), 5, false, testName, true); // number of bytes processed pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "SUCCESS: The expected number of bytes (" + totalBytes.ToString() + ") have been received", 1, false, testName, true); // Verify that echo is part of the output pass = MyUtils.WaitForProcessToFinish(logOutputClientRestartedFileName_TestApp, "SUCCESS: The expected number of echoed bytes (" + totalEchoBytes.ToString() + ") have been received", 1, false, testName, true, false); pass = MyUtils.WaitForProcessToFinish(logOutputClientRestartedFileName_TestApp, "All rounds complete (" + messagesSent.ToString() + " messages sent)", 1, false, testName, true, false); pass = MyUtils.WaitForProcessToFinish(logOutputClientRestartedFileName_TestApp, "[IC] Connected!", 1, false, testName, true, false); // Verify integrity of Ambrosia logs by replaying JSUtils.JS_VerifyTimeTravelDebugging(testName, numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, true, "", JSUtils.JSPTI_ServerInstanceRole); }
public void JS_PTI_BasicRestartEndToEnd_Test() { Utilities MyUtils = new Utilities(); JS_Utilities JSUtils = new JS_Utilities(); int numRounds = 20; long totalBytes = 327680; long totalEchoBytes = 327680; int bytesPerRound = 16384; int maxMessageSize = 64; int batchSizeCutoff = 16384; int messagesSent = 5120; bool bidi = false; string originaltestName = "jsptirestartendtoendtest"; string testName = originaltestName + uniqueTestNameID; // this is the version to make it unqiue so other CI tests don't affect it string logOutputFileName_TestApp = testName + "_TestApp.log"; string logOutputFileNameRestarted_TestApp = testName + "_TestApp_Restarted.log"; JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, testName); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_LBOpt_deleteLogs, "false"); // default is false but ok to specifically state in case default changes // Start it once JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputFileName_TestApp); // Give it 2 seconds where it tries to connect but doesn't MyUtils.TestDelay(2000); // Kill it MyUtils.StopAllAmbrosiaProcesses(); // Restart it and make sure it continues JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputFileNameRestarted_TestApp); // Verify the data in the restarted output file bool pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "Bytes received: " + totalBytes.ToString(), 5, false, testName, true); // number of bytes processed pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "SUCCESS: The expected number of bytes (" + totalBytes.ToString() + ") have been received", 1, false, testName, true); // Verify that echo is NOT part of the output - won't pop assert on fail so check return value pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "SUCCESS: The expected number of echoed bytes (" + totalEchoBytes.ToString() + ") have been received", 0, true, testName, false, false); if (pass == true) { Assert.Fail("<JS_PTI_BasicEndToEnd_Test> Echoed string should NOT have been found in the output but it was."); } pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "All rounds complete (" + messagesSent.ToString() + " messages sent)", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "[IC] Connected!", 1, false, testName, true); // Verify integrity of Ambrosia logs by replaying JSUtils.JS_VerifyTimeTravelDebugging(testName, numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, true); }
public void JS_PTI_RestartTwoProcKillBoth_BiDi_Test() { Utilities MyUtils = new Utilities(); JS_Utilities JSUtils = new JS_Utilities(); int numRounds = 3; long totalBytes = 3221225472; long totalEchoBytes = 3221225472; int bytesPerRound = 0; int maxMessageSize = 0; int batchSizeCutoff = 0; bool bidi = true; string testName = "jsptirestartkillbothbidi"; string clientInstanceName = testName + "client"; string serverInstanceName = testName + "server"; string logOutputClientFileName_TestApp = testName + "Client_TestApp.log"; string logOutputServerFileName_TestApp = testName + "Server_TestApp.log"; string logOutputClientRestartedFileName_TestApp = testName + "Client_TestApp_Restarted.log"; string logOutputServerRestartedFileName_TestApp = testName + "Server_TestApp_Restarted.log"; JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, testName, JSUtils.JSPTI_CombinedInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, clientInstanceName, JSUtils.JSPTI_ClientInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, serverInstanceName, JSUtils.JSPTI_ServerInstanceRole); // Start it once - Launch the client and the server as separate procs int clientProcessID = JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputClientFileName_TestApp, 0, false, JSUtils.JSPTI_ClientInstanceRole, serverInstanceName); int serverProcessID = JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputServerFileName_TestApp, 0, false, JSUtils.JSPTI_ServerInstanceRole); // Give it 5 seconds where it tries to connect but doesn't MyUtils.TestDelay(5000); // Kill server and client MyUtils.StopAllAmbrosiaProcesses(); // Restart the server and client and make sure it continues serverProcessID = JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputServerRestartedFileName_TestApp, 0, false, JSUtils.JSPTI_ServerInstanceRole); clientProcessID = JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputClientRestartedFileName_TestApp, 0, false, JSUtils.JSPTI_ClientInstanceRole, serverInstanceName); // Verify the data in the restarted output file bool pass = MyUtils.WaitForProcessToFinish(logOutputServerRestartedFileName_TestApp, "Bytes received: " + totalBytes.ToString(), 5, false, testName, true); // number of bytes processed pass = MyUtils.WaitForProcessToFinish(logOutputServerRestartedFileName_TestApp, "SUCCESS: The expected number of bytes (" + totalBytes.ToString() + ") have been received", 1, false, testName, true, false); // Verify that echo is part of the output pass = MyUtils.WaitForProcessToFinish(logOutputClientRestartedFileName_TestApp, "SUCCESS: The expected number of echoed bytes (" + totalEchoBytes.ToString() + ") have been received", 1, false, testName, true, false); pass = MyUtils.WaitForProcessToFinish(logOutputClientRestartedFileName_TestApp, "All rounds complete", 1, false, testName, true, false); pass = MyUtils.WaitForProcessToFinish(logOutputClientRestartedFileName_TestApp, "[IC] Connected!", 1, false, testName, true, false); // Verify integrity of Ambrosia logs by replaying JSUtils.JS_VerifyTimeTravelDebugging(testName, numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, true, "", JSUtils.JSPTI_ServerInstanceRole); }
public void JS_PTI_BasicTwoProc_Test() { Utilities MyUtils = new Utilities(); JS_Utilities JSUtils = new JS_Utilities(); string originaltestName = "jsptitwoproctest"; string testName = originaltestName + uniqueTestNameID; // this is the version to make it unqiue so other CI tests don't affect it int numRounds = 3; long totalBytes = 3221225472; long totalEchoBytes = 3221225472; int bytesPerRound = 0; int maxMessageSize = 0; int batchSizeCutoff = 0; int messagesSent = 114688; bool bidi = false; string clientInstanceName = testName + "client"; string serverInstanceName = testName + "server"; string logOutputClientFileName_TestApp = testName + "Client_TestApp.log"; string logOutputServerFileName_TestApp = testName + "Server_TestApp.log"; JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, testName, JSUtils.JSPTI_CombinedInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, clientInstanceName, JSUtils.JSPTI_ClientInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, serverInstanceName, JSUtils.JSPTI_ServerInstanceRole); // Launch the client and the server as separate procs JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputServerFileName_TestApp, 0, false, JSUtils.JSPTI_ServerInstanceRole); JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputClientFileName_TestApp, 0, false, JSUtils.JSPTI_ClientInstanceRole, serverInstanceName); // Verify the data in the output file of the server bool pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "Bytes received: " + totalBytes.ToString(), 10, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "SUCCESS: The expected number of bytes (" + totalBytes.ToString() + ") have been received", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "[IC] Connected!", 1, false, testName, true); // Verify the data in the output file of the CLIENT - since not bidi, no echoed bytes // Verify that echo is NOT part of the output for client pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "All rounds complete (" + messagesSent.ToString() + " messages sent)", 5, false, testName, true, false); pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "SUCCESS: The expected number of echoed bytes (" + totalEchoBytes.ToString() + ") have been received", 0, true, testName, false, false); if (pass == true) { Assert.Fail("<JS_PTI_BasicEndToEnd_Test> Echoed string should NOT have been found in the CLIENT output but it was."); } pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "[IC] Connected!", 1, false, testName, true, false); pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "round #" + numRounds.ToString(), 1, false, testName, true, false); // Verify integrity of Ambrosia logs by replaying server side of things (not bidi so only do Server) JSUtils.JS_VerifyTimeTravelDebugging(testName, numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, true, "", JSUtils.JSPTI_ServerInstanceRole); }
public void JS_PTI_Blob_Test() { Utilities MyUtils = new Utilities(); JS_Utilities JSUtils = new JS_Utilities(); int numRounds = 5; long totalBytes = 640; long totalEchoBytes = 640; int bytesPerRound = 128; int maxMessageSize = 64; int batchSizeCutoff = 32; int messagesSent = 10; bool bidi = false; string testName = "jsptisavetoblobtest"; string logOutputFileName_TestApp = testName + "_TestApp.log"; // update config values for test JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, testName); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icLogStorageType, JSUtils.logTypeBlobs); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icLogFolder, ""); // Launch but it is using blobs instead of files JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputFileName_TestApp); // Verify the data in the output file - too many changing rows in output to do a cmp file so verify some of the key lines bool pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "Bytes received: " + totalBytes.ToString(), 10, false, testName, true); // number of bytes processed pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "SUCCESS: The expected number of bytes (" + totalBytes.ToString() + ") have been received", 1, false, testName, true); // Verify that echo is NOT part of the output - won't pop assert on fail so check return value pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "SUCCESS: The expected number of echoed bytes (" + totalEchoBytes.ToString() + ") have been received", 0, true, testName, false, false); if (pass == true) { Assert.Fail("<JS_PTI_Blob_Basic_Test> Echoed string should NOT have been found in the output but it was."); } pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "All rounds complete (" + messagesSent.ToString() + " messages sent)", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "[IC] Connected!", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "round #" + numRounds.ToString(), 1, false, testName, true); // Verify that directory does not exist to show it wasn't in a file as not real easy ways to verify blob string logDirectory = MyUtils.baseAmbrosiaPath + ConfigurationManager.AppSettings["AmbrosiaLogDirectory"]; string expectedLogFile = logDirectory + "\\" + testName + "_0"; if (Directory.Exists(expectedLogFile)) { Assert.Fail("<JS_PTI_Blob_Basic_Test> - Directory:" + expectedLogFile + " was found when it shouldn't have been."); } }
public void JS_PTI_BasicTwoProc_PostMeth_Test() { Utilities MyUtils = new Utilities(); JS_Utilities JSUtils = new JS_Utilities(); string originaltestName = "jsptitwoprocpostmeth"; string testName = originaltestName + uniqueTestNameID; // this is the version to make it unqiue so other CI tests don't affect it int numRounds = 4; long totalBytes = 4294967296; long totalEchoBytes = 4294967296; int bytesPerRound = 0; int maxMessageSize = 0; int batchSizeCutoff = 0; int messagesSent = 245760; bool bidi = false; string clientInstanceName = testName + "client"; string serverInstanceName = testName + "server"; string logOutputClientFileName_TestApp = testName + "Client_TestApp.log"; string logOutputServerFileName_TestApp = testName + "Server_TestApp.log"; JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, testName, JSUtils.JSPTI_CombinedInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, clientInstanceName, JSUtils.JSPTI_ClientInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, serverInstanceName, JSUtils.JSPTI_ServerInstanceRole); // Launch the client and the server as separate procs JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputServerFileName_TestApp, 0, false, JSUtils.JSPTI_ServerInstanceRole, "", true); JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputClientFileName_TestApp, 0, false, JSUtils.JSPTI_ClientInstanceRole, serverInstanceName, true); // Verify the data in the output file of the server bool pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "Bytes received: " + totalBytes.ToString(), 10, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "SUCCESS: The expected number of bytes (" + totalBytes.ToString() + ") have been received", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "[IC] Connected!", 1, false, testName, true); // Verify the data in the output file of the CLIENT - since not bidi, no echoed bytes // Verify that echo is NOT part of the output for client pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "All rounds complete (" + messagesSent.ToString() + " messages sent)", 5, false, testName, true, false); pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "[IC] Connected!", 1, false, testName, true, false); pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "round #" + numRounds.ToString(), 1, false, testName, true, false); // Verify the Post Method messages pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "SUCCESS: The result handler for the 'incrementValue' post method was called the expected number of times (245760)", 1, false, testName, true, false); // Verify integrity of Ambrosia logs by replaying server side of things (not bidi so only do Server which will not show Post Meth) JSUtils.JS_VerifyTimeTravelDebugging(testName, numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, true, "", JSUtils.JSPTI_ServerInstanceRole); }
public void JS_PTI_BasicRestartEndToEnd_BiDi_Test() { Utilities MyUtils = new Utilities(); JS_Utilities JSUtils = new JS_Utilities(); int numRounds = 4; long totalBytes = 4294967296; long totalEchoBytes = 4294967296; int bytesPerRound = 0; int maxMessageSize = 0; int batchSizeCutoff = 0; bool bidi = true; string originaltestName = "jsptirestartendtoendbiditest"; string testName = originaltestName + uniqueTestNameID; // this is the version to make it unqiue so other CI tests don't affect it string logOutputFileName_TestApp = testName + "_TestApp.log"; string logOutputFileNameRestarted_TestApp = testName + "_TestApp_Restarted.log"; JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, testName); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_LBOpt_deleteLogs, "false"); // default is false but ok to specifically state in case default changes // Start it once JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputFileName_TestApp); // Give it 10 seconds to do something before killing it MyUtils.TestDelay(10000); // Kill it MyUtils.StopAllAmbrosiaProcesses(); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_LBOpt_deleteLogs, "false"); // default is false but ok to specifically state in case default changes JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_autoRegister, "false"); // get auto changed to false but ok to specifically state in case default changes // Restart it and make sure it continues JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputFileNameRestarted_TestApp); // Verify the data in the restarted output file bool pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "Bytes received: " + totalBytes.ToString(), 15, false, testName, true); // number of bytes processed pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "SUCCESS: The expected number of bytes (" + totalBytes.ToString() + ") have been received", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "SUCCESS: The expected number of echoed bytes (" + totalEchoBytes.ToString() + ") have been received", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "All rounds complete", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "[IC] Connected!", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "round #" + numRounds.ToString(), 1, false, testName, true); // Verify integrity of Ambrosia logs by replaying JSUtils.JS_VerifyTimeTravelDebugging(testName, numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, true); }
public void JS_PTI_BasicEndToEnd_PostMeth_Test() { Utilities MyUtils = new Utilities(); JS_Utilities JSUtils = new JS_Utilities(); int numRounds = 4; long totalBytes = 4294967296; long totalEchoBytes = 4294967296; int bytesPerRound = 0; int maxMessageSize = 0; int batchSizeCutoff = 0; int messagesSent = 245760; bool bidi = false; string logTriggerSize = "256"; string originaltestName = "jsptiendtoendtestpostmeth"; string testName = originaltestName + uniqueTestNameID; // this is the version to make it unqiue so other CI tests don't affect it string logOutputFileName_TestApp = testName + "_TestApp.log"; string logOutputFileName_TTDVerify = testName + "__VerifyTTD_1.log"; JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, testName); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_logTriggerSizeinMB, logTriggerSize); JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputFileName_TestApp, 0, false, "", "", true); // Verify the data in the output file - too many changing rows in output to do a cmp file so verify some of the key lines bool pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "Bytes received: " + totalBytes.ToString(), 5, false, testName, true); // number of bytes processed pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "SUCCESS: The expected number of bytes (" + totalBytes.ToString() + ") have been received", 1, false, testName, true); // Verify that echo is NOT part of the output - won't pop assert on fail so check return value pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "All rounds complete (" + messagesSent.ToString() + " messages sent)", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "round #" + numRounds.ToString(), 1, false, testName, true); // Verify the Post Method messages pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "outgoing messages and 768 in-flight post methods...", 1, false, testName, true); // The "Waiting for xxx number changes from run to run pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "Outgoing message queue is empty; there are no in-flight post methods", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "SUCCESS: The result handler for the 'incrementValue' post method was called the expected number of times (245760)", 1, false, testName, true); // Verify integrity of Ambrosia logs by replaying JSUtils.JS_VerifyTimeTravelDebugging(testName, numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TTDVerify, "outgoing messages and 768 in-flight post methods...", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TTDVerify, "Outgoing message queue is empty; there are no in-flight post methods", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TTDVerify, "SUCCESS: The result handler for the 'incrementValue' post method was called the expected number of times (245760)", 1, false, testName, true); }
public void JS_PTI_Blob_DeleteLog_Test() { Utilities MyUtils = new Utilities(); JS_Utilities JSUtils = new JS_Utilities(); int numRounds = 4; long totalBytes = 512; long totalEchoBytes = 512; int bytesPerRound = 128; int maxMessageSize = 64; int batchSizeCutoff = 32; bool bidi = false; string testName = "jsptiblobdeletelogtest"; string logOutputFileName_TestApp = testName + "_TestApp.log"; string logOutputFileName_2_TestApp = testName + "_2_TestApp.log"; // update config values for test JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, testName); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icLogStorageType, JSUtils.logTypeBlobs); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icLogFolder, ""); // Launch it once JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputFileName_TestApp); // Verify the data in the output file - too many changing rows in output to do a cmp file so verify some of the key lines bool pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "Bytes received: " + totalBytes.ToString(), 5, false, testName, true); // number of bytes processed // set to delete the log JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_LBOpt_deleteLogs, "true"); // Launch it again JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputFileName_2_TestApp); // Verify the data in the output file - too many changing rows in output to do a cmp file so verify some of the key lines pass = MyUtils.WaitForProcessToFinish(logOutputFileName_2_TestApp, "Bytes received: " + totalBytes.ToString(), 5, false, testName, true); // number of bytes processed //*** If the logs were NOT deleted then it would be "loading" a check point. If it is deleted then the checkpoint is just saved pass = MyUtils.WaitForProcessToFinish(logOutputFileName_2_TestApp, "Checkpoint saved:", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileName_2_TestApp, "Checkpoint loaded", 0, true, testName, false, false); if (pass == true) { Assert.Fail("<JS_PTI_Blob_DeleteLog_Test> Checkpoint loaded was found so must read log files that already existed."); } }
public void JS_PTI_BasicEndToEnd_Test() { Utilities MyUtils = new Utilities(); JS_Utilities JSUtils = new JS_Utilities(); int numRounds = 4; long totalBytes = 4294967296; long totalEchoBytes = 4294967296; int bytesPerRound = 0; int maxMessageSize = 0; int batchSizeCutoff = 0; int messagesSent = 245760; bool bidi = false; string logTriggerSize = "256"; // set a test to have 256 which is different from 1024 which is set in the BasieEndToEndBiDi string originaltestName = "jsptiendtoendtest"; string testName = originaltestName + uniqueTestNameID; // this is the version to make it unqiue so other CI tests don't affect it string logOutputFileName_TestApp = testName + "_TestApp.log"; JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, testName); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_logTriggerSizeinMB, logTriggerSize); JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputFileName_TestApp); // Verify the data in the output file - too many changing rows in output to do a cmp file so verify some of the key lines bool pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "Bytes received: " + totalBytes.ToString(), 5, false, testName, true); // number of bytes processed pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "SUCCESS: The expected number of bytes (" + totalBytes.ToString() + ") have been received", 1, false, testName, true); // Verify that echo is NOT part of the output - won't pop assert on fail so check return value pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "SUCCESS: The expected number of echoed bytes (" + totalEchoBytes.ToString() + ") have been received", 0, true, testName, false, false); if (pass == true) { Assert.Fail("<JS_PTI_BasicEndToEnd_Test> Echoed string should NOT have been found in the output but it was."); } pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "All rounds complete (" + messagesSent.ToString() + " messages sent)", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "[IC] Connected!", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "round #" + numRounds.ToString(), 1, false, testName, true); // Verify integrity of Ambrosia logs by replaying JSUtils.JS_VerifyTimeTravelDebugging(testName, numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, true); }
public void JS_PTI_RestartAfterFinishes_BiDi_Test() { Utilities MyUtils = new Utilities(); JS_Utilities JSUtils = new JS_Utilities(); int numRounds = 5; long totalBytes = 640; long totalEchoBytes = 640; int bytesPerRound = 128; int maxMessageSize = 64; int batchSizeCutoff = 32; int messagesSent = 10; bool bidi = true; string testName = "jsptirestartafterfinishesbiditest"; string logOutputFileName_TestApp = testName + "_TestApp.log"; string logOutputFileNameRestarted_TestApp = testName + "_TestApp_Restarted.log"; JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, testName); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_LBOpt_deleteLogs, "false"); // default is false but ok to specifically state in case default changes // Start it once JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputFileName_TestApp); // Wait until it finishes bool pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "Bytes received: " + totalBytes.ToString(), 5, false, testName, true); // number of bytes processed // Restart it and make sure it runs ok JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputFileNameRestarted_TestApp); // Verify the data in the restarted output file pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "Bytes received: " + totalBytes.ToString(), 5, false, testName, true); // number of bytes processed pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "SUCCESS: The expected number of bytes (" + totalBytes.ToString() + ") have been received", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "SUCCESS: The expected number of echoed bytes (" + totalEchoBytes.ToString() + ") have been received", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "All rounds complete (" + messagesSent.ToString() + " messages sent)", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "Checkpoint loaded", 1, false, testName, true); // since it is restarted, it loads the check point pass = MyUtils.WaitForProcessToFinish(logOutputFileNameRestarted_TestApp, "round #" + numRounds.ToString(), 1, false, testName, true); // Verify integrity of Ambrosia logs by replaying JSUtils.JS_VerifyTimeTravelDebugging(testName, numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, true); }
public void JS_PTI_Blob_TwoProc_BiDi_Test() { Utilities MyUtils = new Utilities(); JS_Utilities JSUtils = new JS_Utilities(); string testName = "jsptiblobtwoprocbiditest"; int numRounds = 2; long totalBytes = 8192; long totalEchoBytes = 8192; int bytesPerRound = 4096; int maxMessageSize = 256; int batchSizeCutoff = 256; int messagesSent = 48; bool bidi = true; string clientInstanceName = testName + "client"; string serverInstanceName = testName + "server"; string logOutputClientFileName_TestApp = testName + "Client_TestApp.log"; string logOutputServerFileName_TestApp = testName + "Server_TestApp.log"; JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, testName, JSUtils.JSPTI_CombinedInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, clientInstanceName, JSUtils.JSPTI_ClientInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, serverInstanceName, JSUtils.JSPTI_ServerInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icLogStorageType, JSUtils.logTypeBlobs, JSUtils.JSPTI_ClientInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icLogFolder, "", JSUtils.JSPTI_ClientInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icLogStorageType, JSUtils.logTypeBlobs, JSUtils.JSPTI_ServerInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icLogFolder, "", JSUtils.JSPTI_ServerInstanceRole); // Launch the client and the server as separate procs JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputServerFileName_TestApp, 0, false, JSUtils.JSPTI_ServerInstanceRole); JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputClientFileName_TestApp, 0, false, JSUtils.JSPTI_ClientInstanceRole, serverInstanceName); // Verify the data in the output file of the server bool pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "Bytes received: " + totalBytes.ToString(), 10, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "SUCCESS: The expected number of bytes (" + totalBytes.ToString() + ") have been received", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "[IC] Connected!", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "logStorageType=Blobs", 1, false, testName, true); // Verify the data in the output file of the CLIENT pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "SUCCESS: The expected number of echoed bytes (" + totalEchoBytes.ToString() + ") have been received", 5, true, testName, true, false); pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "All rounds complete (" + messagesSent.ToString() + " messages sent)", 5, false, testName, true, false); pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "[IC] Connected!", 1, false, testName, true, false); pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "round #" + numRounds.ToString(), 1, false, testName, true, false); }
// Derived from JSUtils.JS_RestoreJSConfigFile but modified for the config file for separated public void RestoreSeparatedJSConfigFile() { try { Utilities MyUtils = new Utilities(); JS_Utilities JSUtils = new JS_Utilities(); // ** Restore Config file from golden one string basePath = MyUtils.baseAmbrosiaPath + ConfigurationManager.AppSettings["AmbrosiaJSTestDirectory"]; string basePTIPath = MyUtils.baseAmbrosiaPath + ConfigurationManager.AppSettings["AmbrosiaJSPTIDirectory"]; string ambrosiaSeparatedGoldConfigfileName = "ambrosiaConfig.separatedGOLD.json"; string ambrosiaConfigfileName = "ambrosiaConfig.json"; //** Set defaults that are test run specific string CurrentFramework = MyUtils.NetFramework; if (MyUtils.NetFrameworkTestRun == false) { CurrentFramework = MyUtils.NetCoreFramework; } //*** Copy from The Gold Config to App Config *** File.Copy(basePath + "\\" + ambrosiaSeparatedGoldConfigfileName, basePTIPath + JSUtils.JSPTI_AppPath + "\\" + ambrosiaConfigfileName, true); //*** Copy from The Gold Config to Client Config *** File.Copy(basePath + "\\" + ambrosiaSeparatedGoldConfigfileName, basePTIPath + JSUtils.JSPTI_ClientPath + "\\" + ambrosiaConfigfileName, true); // Set the defaults based on current system JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icCraPort, "2510", JSUtils.JSPTI_ClientInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icReceivePort, "2010", JSUtils.JSPTI_ClientInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icSendPort, "2011", JSUtils.JSPTI_ClientInstanceRole); //*** Copy from The Gold Config to Server Config *** File.Copy(basePath + "\\" + ambrosiaSeparatedGoldConfigfileName, basePTIPath + JSUtils.JSPTI_ServerPath + "\\" + ambrosiaConfigfileName, true); // Set the defaults based on current system JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icCraPort, "2500", JSUtils.JSPTI_ServerInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icReceivePort, "2000", JSUtils.JSPTI_ServerInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icSendPort, "2001", JSUtils.JSPTI_ServerInstanceRole); } catch (Exception e) { Assert.Fail("<RestoreSeparatedJSConfigFile> Failure! " + e.Message); } }
public void JS_PTI_HostingModeSeparate_TwoProc_Test() { Utilities MyUtils = new Utilities(); JS_Utilities JSUtils = new JS_Utilities(); int numRounds = 2; long totalBytes = 8192; long totalEchoBytes = 8192; int bytesPerRound = 4096; int maxMessageSize = 256; int batchSizeCutoff = 256; int messagesSent = 48; bool bidi = false; string testName = "jsptihostmodeseparatetesttwoproc"; string clientInstanceName = testName + "client"; string serverInstanceName = testName + "server"; string logOutputClientFileName_TestApp = testName + "Client_TestApp.log"; string logOutputServerFileName_TestApp = testName + "Server_TestApp.log"; string ambrosiaLogDir = MyUtils.baseAmbrosiaPath + ConfigurationManager.AppSettings["AmbrosiaLogDirectory"] + "\\"; string logOutputFileName_ImmCoord1 = testName + "_ImmCoord1.log"; // Set name and ports to match IC call for client and server JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, clientInstanceName, JSUtils.JSPTI_ClientInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icCraPort, "1500", JSUtils.JSPTI_ClientInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icReceivePort, "1000", JSUtils.JSPTI_ClientInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icSendPort, "1001", JSUtils.JSPTI_ClientInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, serverInstanceName, JSUtils.JSPTI_ServerInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icCraPort, "2500", JSUtils.JSPTI_ServerInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icReceivePort, "2000", JSUtils.JSPTI_ServerInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icSendPort, "2001", JSUtils.JSPTI_ServerInstanceRole); // Manually register the instance string logOutputFileName_AMB1 = testName + "_AMB1.log"; AMB_Settings AMB1 = new AMB_Settings { AMB_ServiceName = clientInstanceName, AMB_PortAppReceives = "1000", AMB_PortAMBSends = "1001", AMB_ServiceLogPath = ambrosiaLogDir, AMB_CreateService = "A", AMB_PauseAtStart = "N", AMB_PersistLogs = "Y", AMB_NewLogTriggerSize = "1000", AMB_ActiveActive = "N", AMB_Version = "0" }; MyUtils.CallAMB(AMB1, logOutputFileName_AMB1, AMB_ModeConsts.RegisterInstance); //AMB2 string logOutputFileName_AMB2 = testName + "_AMB2.log"; AMB_Settings AMB2 = new AMB_Settings { AMB_ServiceName = serverInstanceName, AMB_PortAppReceives = "2000", AMB_PortAMBSends = "2001", AMB_ServiceLogPath = ambrosiaLogDir, AMB_CreateService = "A", AMB_PauseAtStart = "N", AMB_PersistLogs = "Y", AMB_NewLogTriggerSize = "1000", AMB_ActiveActive = "N", AMB_Version = "0" }; MyUtils.CallAMB(AMB2, logOutputFileName_AMB2, AMB_ModeConsts.RegisterInstance); // manually start the IC int ImmCoordProcessID1 = MyUtils.StartImmCoord(clientInstanceName, 1500, logOutputFileName_ImmCoord1); //ImmCoord2 string logOutputFileName_ImmCoord2 = testName + "_ImmCoord2.log"; int ImmCoordProcessID2 = MyUtils.StartImmCoord(serverInstanceName, 2500, logOutputFileName_ImmCoord2); // Start JS client and server JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputServerFileName_TestApp, 0, false, JSUtils.JSPTI_ServerInstanceRole); JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputClientFileName_TestApp, 0, false, JSUtils.JSPTI_ClientInstanceRole, serverInstanceName); // Verify the data in the restarted output file bool pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "Bytes received: " + totalBytes.ToString(), 5, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "SUCCESS: The expected number of bytes (" + totalBytes.ToString() + ") have been received", 1, false, testName, true); // Verify that echo is NOT part of the output - won't pop assert on fail so check return value pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "SUCCESS: The expected number of echoed bytes (" + totalEchoBytes.ToString() + ") have been received", 0, true, testName, false, false); if (pass == true) { Assert.Fail("<JS_PTI_HostingModeSeparate_TwoProc_Test> Echoed string should NOT have been found in the output but it was."); } pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "All rounds complete (" + messagesSent.ToString() + " messages sent)", 1, false, testName, true, false); pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "[IC]", 0, true, testName, false, false); // shouldn't be any IC comments if (pass == true) { Assert.Fail("<JS_PTI_HostingModeSeparate_TwoProc_Test> There shouldn't be any Imm Coord messages in output since separate process"); } // Do not verify logs as the setting 'debugStartCheckpoint' is not allowed for Separate host mode //JSUtils.JS_VerifyTimeTravelDebugging(testName, numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, true); }
public void JS_PTI_HostingModeSeparateStartPTIFirst_BiDi_Test() { Utilities MyUtils = new Utilities(); JS_Utilities JSUtils = new JS_Utilities(); int numRounds = 2; long totalBytes = 8192; long totalEchoBytes = 8192; int bytesPerRound = 4096; int maxMessageSize = 256; int batchSizeCutoff = 256; int messagesSent = 48; bool bidi = true; string testName = "jsptihostmodesepptifirsttest"; string logOutputFileName_TestApp = testName + "_TestApp.log"; string ambrosiaLogDir = MyUtils.baseAmbrosiaPath + ConfigurationManager.AppSettings["AmbrosiaLogDirectory"] + "\\"; string logOutputFileName_ImmCoord1 = testName + "_ImmCoord1.log"; JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, testName); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icCraPort, "1500"); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icReceivePort, "1000"); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icSendPort, "1001"); // Manually register the instance string logOutputFileName_AMB1 = testName + "_AMB1.log"; AMB_Settings AMB1 = new AMB_Settings { AMB_ServiceName = testName, AMB_PortAppReceives = "1000", AMB_PortAMBSends = "1001", AMB_ServiceLogPath = ambrosiaLogDir, AMB_CreateService = "A", AMB_PauseAtStart = "N", AMB_PersistLogs = "Y", AMB_NewLogTriggerSize = "1000", AMB_ActiveActive = "N", AMB_Version = "0" }; MyUtils.CallAMB(AMB1, logOutputFileName_AMB1, AMB_ModeConsts.RegisterInstance); // Start JS app JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputFileName_TestApp); // manually start the IC after the PTI was started int ImmCoordProcessID1 = MyUtils.StartImmCoord(testName, 1500, logOutputFileName_ImmCoord1); // Verify the data in the output file - too many changing rows in output to do a cmp file so verify some of the key lines bool pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "Bytes received: " + totalBytes.ToString(), 5, false, testName, true); // number of bytes processed pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "SUCCESS: The expected number of bytes (" + totalBytes.ToString() + ") have been received", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "SUCCESS: The expected number of echoed bytes (" + totalEchoBytes.ToString() + ") have been received", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "All rounds complete (" + messagesSent.ToString() + " messages sent)", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "round #" + numRounds.ToString(), 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputFileName_TestApp, "[IC]", 0, true, testName, false, false); // shouldn't be any IC comments if (pass == true) { Assert.Fail("<JS_PTI_HostingModeSeparateStartPTIFirst_Test> There shouldn't be any Imm Coord messages in output since separate process"); } }
public void JS_PTI_BlobServerFile_TwoProc_Test() { Utilities MyUtils = new Utilities(); JS_Utilities JSUtils = new JS_Utilities(); string testName = "jsptiblobserverfiletwoproctest"; int numRounds = 4; long totalBytes = 16384; long totalEchoBytes = 16384; int bytesPerRound = 4096; int maxMessageSize = 256; int batchSizeCutoff = 256; int messagesSent = 176; bool bidi = false; string clientInstanceName = testName + "client"; string serverInstanceName = testName + "server"; string logOutputClientFileName_TestApp = testName + "Client_TestApp.log"; string logOutputServerFileName_TestApp = testName + "Server_TestApp.log"; JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, testName, JSUtils.JSPTI_CombinedInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, clientInstanceName, JSUtils.JSPTI_ClientInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_instanceName, serverInstanceName, JSUtils.JSPTI_ServerInstanceRole); // JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icLogStorageType, JSUtils.logTypeBlobs, JSUtils.JSPTI_ClientInstanceRole); // keep client as a file // JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icLogFolder, "", JSUtils.JSPTI_ClientInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icLogStorageType, JSUtils.logTypeBlobs, JSUtils.JSPTI_ServerInstanceRole); JSUtils.JS_UpdateJSConfigFile(JSUtils.JSConfig_icLogFolder, "", JSUtils.JSPTI_ServerInstanceRole); // Launch the client and the server as separate procs JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputServerFileName_TestApp, 0, false, JSUtils.JSPTI_ServerInstanceRole); JSUtils.StartJSPTI(numRounds, totalBytes, totalEchoBytes, bytesPerRound, maxMessageSize, batchSizeCutoff, bidi, logOutputClientFileName_TestApp, 0, false, JSUtils.JSPTI_ClientInstanceRole, serverInstanceName); // Verify the data in the output file of the server bool pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "Bytes received: " + totalBytes.ToString(), 10, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "SUCCESS: The expected number of bytes (" + totalBytes.ToString() + ") have been received", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "[IC] Connected!", 1, false, testName, true); pass = MyUtils.WaitForProcessToFinish(logOutputServerFileName_TestApp, "logStorageType=Blobs", 1, false, testName, true); // Verify the data in the output file of the CLIENT - since not bidi, no echoed bytes // Verify that echo is NOT part of the output for client pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "SUCCESS: The expected number of echoed bytes (" + totalEchoBytes.ToString() + ") have been received", 0, true, testName, false, false); if (pass == true) { Assert.Fail("<JS_PTI_BlobServerFile_BasicTwoProc_Test> Echoed string should NOT have been found in the CLIENT output but it was."); } pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "All rounds complete (" + messagesSent.ToString() + " messages sent)", 5, false, testName, true, false); pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "[IC] Connected!", 1, false, testName, true, false); pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "round #" + numRounds.ToString(), 1, false, testName, true, false); pass = MyUtils.WaitForProcessToFinish(logOutputClientFileName_TestApp, "logStorageType=Files", 1, false, testName, true, false); // Verify that directory does not exist to show it wasn't in a file as not real easy ways to verify blob string logDirectory = MyUtils.baseAmbrosiaPath + ConfigurationManager.AppSettings["AmbrosiaLogDirectory"]; string expectedClientLogFile = logDirectory + "\\" + testName + "client_0"; if (Directory.Exists(expectedClientLogFile) == false) { Assert.Fail("<JS_PTI_BlobServerFile_BasicTwoProc_Test> - Directory:" + expectedClientLogFile + " was NOT found."); } string expectedServerLogFile = logDirectory + "\\" + testName + "server_0"; if (Directory.Exists(expectedServerLogFile)) { Assert.Fail("<JS_PTI_BlobServerFile_BasicTwoProc_Test> - Directory:" + expectedServerLogFile + " was found when it shouldn't have been."); } }