From dd14ad52ea8e00bc16086c436d289d0d398b2503 Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Tue, 14 Nov 2006 12:58:52 +0000 Subject: [PATCH] - update svn properties - improve error checking - return -2 when the test fails - add a few test configs (required for sysregtest target) svn path=/trunk/; revision=24751 --- reactos/tools/sysreg/rosboot_test.cpp | 48 +++++++---- reactos/tools/sysreg/runonce.cfg | 117 +++++++++++++++++++++++++ reactos/tools/sysreg/secstage.cfg | 118 +++++++++++++++++++++++++ reactos/tools/sysreg/sysreg.cpp | 1 + reactos/tools/sysreg/txtmode.cfg | 119 ++++++++++++++++++++++++++ 5 files changed, 384 insertions(+), 19 deletions(-) create mode 100644 reactos/tools/sysreg/runonce.cfg create mode 100644 reactos/tools/sysreg/secstage.cfg create mode 100644 reactos/tools/sysreg/txtmode.cfg diff --git a/reactos/tools/sysreg/rosboot_test.cpp b/reactos/tools/sysreg/rosboot_test.cpp index dae1207e0e5..bba5df3bd28 100644 --- a/reactos/tools/sysreg/rosboot_test.cpp +++ b/reactos/tools/sysreg/rosboot_test.cpp @@ -325,15 +325,21 @@ namespace Sysreg_ OsSupport::ProcessID pid = OsSupport::createProcess ((TCHAR*)boot_cmd.c_str (), 0, NULL); string::size_type pipe_pos = boot_cmd.find (_T("serial pipe:")); - pipe_pos += 12; - string::size_type pipe_pos_end = boot_cmd.find (_T(" "), pipe_pos); - if (pipe_pos != string::npos && pipe_pos > 0 && pipe_pos < boot_cmd.size()) + + if (pipe_pos != string::npos) { - pipecmd = _T("\\\\.\\pipe\\") + boot_cmd.substr (pipe_pos, pipe_pos_end - pipe_pos); + pipe_pos += 12; + string::size_type pipe_pos_end = boot_cmd.find (_T(" "), pipe_pos); + if (pipe_pos != string::npos && pipe_pos > 0 && pipe_pos < boot_cmd.size()) + { + pipecmd = _T("\\\\.\\pipe\\") + boot_cmd.substr (pipe_pos, pipe_pos_end - pipe_pos); + } } - else + + if (!pipecmd.length ()) { - return false; + //FIXME + pipecmd = _T("\\\\.\\pipe\\vmwaredebug"); } if (m_Delayread) @@ -355,27 +361,31 @@ namespace Sysreg_ bool ret = true; vector vect; - + size_t lines = 0; while(1) { if (isTimeout(m_Timeout)) { break; } - - if (namedpipe_reader.readPipe (vect) != 0) + size_t line_count = namedpipe_reader.readPipe (vect); + if (!line_count) { - DebugState state = checkDebugData(vect); - if (state == DebugStateBSODDetected || state == DebugStateUMEDetected) - { - ret = false; - break; - } - else if (state == DebugStateCPReached) - { - break; - } + cerr << "No data read" << endl; + continue; } + + DebugState state = checkDebugData(vect); + if (state == DebugStateBSODDetected || state == DebugStateUMEDetected) + { + ret = false; + break; + } + else if (state == DebugStateCPReached) + { + break; + } + lines += line_count; } namedpipe_reader.closePipe (); _sleep(3* CLOCKS_PER_SEC); diff --git a/reactos/tools/sysreg/runonce.cfg b/reactos/tools/sysreg/runonce.cfg new file mode 100644 index 00000000000..6fc8121764f --- /dev/null +++ b/reactos/tools/sysreg/runonce.cfg @@ -0,0 +1,117 @@ + ; ROS_OUTPUT +; +; This variable sets the location where to search symbol files for modules +; This is required when tracing usermode exceptions, bsod etc... +; +; If this value is not defined, sysreg looks for the environment variable +; ROS_OUTPUT. If this is also not set, it uses the default output-i386 + +ROS_OUTPUT=D:\reactos\output-i386 + +; ROS_ADDR2LINE +; +; This value is used by the symbol resolver to convert an module address into +; an source file + line number; +; +; Note: The symbol resolver appends the modulename and the module address seperated by an space + +ROS_ADDR2LINE=addr2line.exe --exe= + +;----------------------------------------------------------------------------------------- +; RosBoot specific settings +; + +; +; ROSBOOT_CMD +; +; This value is the command which is executed to gain debugging data +; this value is mandatory + +ROSBOOT_CMD=D:\reactos\qemu\qemu.exe -serial pipe:qemu -boot c -m 128 -L D:\reactos\qemu\ D:\reactos\RosVM.vmdk -pidfile pid.txt + +; +; ROSBOOT_PIDFILE +; +; This option stores the pid of the emulator process in a text file. +; + +ROSBOOT_PID_FILE=pid.txt + +; +; ROSBOOT_DEBUG_PORT +; +; This variable controls on where to look for debugging data. If the +; value is set to file, then sysreg will execute ROSBOOT_CMD and also +; open the file specified in ROSBOOT_DEBUG_FILE and read the debugging info from the file +; +; If the value is set to pipe, then sysreg will read from pipe created by the +; ROSBOOT_CMD +; +;ROSBOOT_DEBUG_PORT=file +ROSBOOT_DEBUG_PORT=pipe + +; +; ROSBOOT_DEBUG_FILE +; +; This value specifies the debug file. This variable must be set when using +; ROSBOOT_DEBUG_PORT=file +; +; Note: when ROSBOOT_DEBUG_PORT is set to pipe, then sysreg will write all received +; debug data to the specified debug file +; + +;ROSBOOT_DEBUG_FILE=D:\ReactOS\tools\sysreg\bsdebug.log +;ROSBOOT_DEBUG_FILE=D:\ReactOS\tools\sysreg\debug.log + +; ROSBOOT_DELAY_READ; +; +; When the emulator is started, it spends a little time loading and running through its +; BIOS. This time delays reading from the pipe/file untill the specified value +; +; the value is in seconds +; +; Note: if the value is not provided, then reading debug info is started immediately + +ROSBOOT_DELAY_READ=4 + + + +; ROSBOOT_TIME_OUT +; +; This variable is the maximum runtime of the ROSBOOT_CMD. If the command +; runs longer than this value, sysreg exits with success mode; +; +; Note: if you set the variable ROSBOOT_CHECK_POINT and the checkpoint is not reached +; within this time, sysreg exits with failure mode +; +; If the variable is not set, the default timeout is 1 minute +; +ROSBOOT_TIME_OUT=180.0 + +; ROSBOOT_CHECK_POINT +; +; RosBoot will stop executing when it finds a string in the form +; SYSREG_CHECKPOINT:CP_NAME +; +; CP_NAME is the value of the ROSBOOT_CHECK_POINT variable + +ROSBOOT_CHECK_POINT=THIRDBOOT_COMPLETE + +; ROSBOOT_CRITICAL_APP +; +; If an user-mode exception occurs in an critical application, i.e. setup.exe / explorer.exe, sysreg will report +; that the test has failed and quit debugging immediately +; +; if an user-mode exception occurs in any other application, sysreg will report the exception but the exception +; has no effect on the test result +; +; Note: if the value is set to IGNORE, sysreg will ignore all user-mode exceptions +; +; Note: if the variable is not set, then sysreg will stop on the first user-mode exception +; +; seperate each application with an space + + +ROSBOOT_CRITICAL_APP=setup.exe userinit.exe smss.exe winlogon.exe csrss.exe explorer.exe +;ROSBOOT_CRITICAL_APP=setup.exe userinit.exe smss.exe winlogon.exe csrss.exe explorer.exe lsass.exe + diff --git a/reactos/tools/sysreg/secstage.cfg b/reactos/tools/sysreg/secstage.cfg new file mode 100644 index 00000000000..c6a0df1d1dc --- /dev/null +++ b/reactos/tools/sysreg/secstage.cfg @@ -0,0 +1,118 @@ + ; ROS_OUTPUT +; +; This variable sets the location where to search symbol files for modules +; This is required when tracing usermode exceptions, bsod etc... +; +; If this value is not defined, sysreg looks for the environment variable +; ROS_OUTPUT. If this is also not set, it uses the default output-i386 + +ROS_OUTPUT=D:\reactos\output-i386 + +; ROS_ADDR2LINE +; +; This value is used by the symbol resolver to convert an module address into +; an source file + line number; +; +; Note: The symbol resolver appends the modulename and the module address seperated by an space + +ROS_ADDR2LINE=addr2line.exe --exe= + +;----------------------------------------------------------------------------------------- +; RosBoot specific settings +; + +; +; ROSBOOT_CMD +; +; This value is the command which is executed to gain debugging data +; this value is mandatory + +ROSBOOT_CMD=D:\reactos\qemu\qemu.exe -serial pipe:qemu -boot c -m 128 -L D:\reactos\qemu\ D:\reactos\RosVM.vmdk -pidfile pid.txt + +; +; ROSBOOT_PIDFILE +; +; This option stores the pid of the emulator process in a text file. +; + +ROSBOOT_PID_FILE=pid.txt + +; +; ROSBOOT_DEBUG_PORT +; +; This variable controls on where to look for debugging data. If the +; value is set to file, then sysreg will execute ROSBOOT_CMD and also +; open the file specified in ROSBOOT_DEBUG_FILE and read the debugging info from the file +; +; If the value is set to pipe, then sysreg will read from pipe created by the +; ROSBOOT_CMD +; +;ROSBOOT_DEBUG_PORT=file +ROSBOOT_DEBUG_PORT=pipe + +; +; ROSBOOT_DEBUG_FILE +; +; This value specifies the debug file. This variable must be set when using +; ROSBOOT_DEBUG_PORT=file +; +; Note: when ROSBOOT_DEBUG_PORT is set to pipe, then sysreg will write all received +; debug data to the specified debug file +; + +;ROSBOOT_DEBUG_FILE=D:\ReactOS\tools\sysreg\bsdebug.log +;ROSBOOT_DEBUG_FILE=D:\ReactOS\tools\sysreg\debug.log + +; ROSBOOT_DELAY_READ; +; +; When the emulator is started, it spends a little time loading and running through its +; BIOS. This time delays reading from the pipe/file untill the specified value +; +; the value is in seconds +; +; Note: if the value is not provided, then reading debug info is started immediately + +ROSBOOT_DELAY_READ=4 + + + +; ROSBOOT_TIME_OUT +; +; This variable is the maximum runtime of the ROSBOOT_CMD. If the command +; runs longer than this value, sysreg exits with success mode; +; +; Note: if you set the variable ROSBOOT_CHECK_POINT and the checkpoint is not reached +; within this time, sysreg exits with failure mode +; +; If the variable is not set, the default timeout is 1 minute +; +ROSBOOT_TIME_OUT=180.0 + +; ROSBOOT_CHECK_POINT +; +; RosBoot will stop executing when it finds a string in the form +; SYSREG_CHECKPOINT:CP_NAME +; +; CP_NAME is the value of the ROSBOOT_CHECK_POINT variable + +ROSBOOT_CHECK_POINT=SYSSETUP_COMPLETE + + +; ROSBOOT_CRITICAL_APP +; +; If an user-mode exception occurs in an critical application, i.e. setup.exe / explorer.exe, sysreg will report +; that the test has failed and quit debugging immediately +; +; if an user-mode exception occurs in any other application, sysreg will report the exception but the exception +; has no effect on the test result +; +; Note: if the value is set to IGNORE, sysreg will ignore all user-mode exceptions +; +; Note: if the variable is not set, then sysreg will stop on the first user-mode exception +; +; seperate each application with an space + + +ROSBOOT_CRITICAL_APP=setup.exe userinit.exe smss.exe winlogon.exe csrss.exe explorer.exe +;ROSBOOT_CRITICAL_APP=setup.exe userinit.exe smss.exe winlogon.exe csrss.exe explorer.exe lsass.exe + diff --git a/reactos/tools/sysreg/sysreg.cpp b/reactos/tools/sysreg/sysreg.cpp index 59d5b85e2eb..e36c2e4ef2c 100644 --- a/reactos/tools/sysreg/sysreg.cpp +++ b/reactos/tools/sysreg/sysreg.cpp @@ -97,6 +97,7 @@ int _tmain(int argc, TCHAR * argv[]) else { cout << "The regression test " << regtest->getName () << " failed" << endl; + return -2; } return 0; diff --git a/reactos/tools/sysreg/txtmode.cfg b/reactos/tools/sysreg/txtmode.cfg new file mode 100644 index 00000000000..27b4cf29da1 --- /dev/null +++ b/reactos/tools/sysreg/txtmode.cfg @@ -0,0 +1,119 @@ + ; ROS_OUTPUT +; +; This variable sets the location where to search symbol files for modules +; This is required when tracing usermode exceptions, bsod etc... +; +; If this value is not defined, sysreg looks for the environment variable +; ROS_OUTPUT. If this is also not set, it uses the default output-i386 + +ROS_OUTPUT=D:\reactos\output-i386 + +; ROS_ADDR2LINE +; +; This value is used by the symbol resolver to convert an module address into +; an source file + line number; +; +; Note: The symbol resolver appends the modulename and the module address seperated by an space + +ROS_ADDR2LINE=addr2line.exe --exe= + +;----------------------------------------------------------------------------------------- +; RosBoot specific settings +; + +; +; ROSBOOT_CMD +; +; This value is the command which is executed to gain debugging data +; this value is mandatory + +ROSBOOT_CMD=D:\reactos\qemu\qemu.exe -serial pipe:qemu -boot d -m 128 -L D:\reactos\qemu\ D:\reactos\RosVM.vmdk -cdrom D:\Reactos\ReactOS-RegTest.iso -pidfile pid.txt + +; +; ROSBOOT_PIDFILE +; +; This option stores the pid of the emulator process in a text file. +; + +ROSBOOT_PID_FILE=pid.txt + +; +; ROSBOOT_DEBUG_PORT +; +; This variable controls on where to look for debugging data. If the +; value is set to file, then sysreg will execute ROSBOOT_CMD and also +; open the file specified in ROSBOOT_DEBUG_FILE and read the debugging info from the file +; +; If the value is set to pipe, then sysreg will read from pipe created by the +; ROSBOOT_CMD +; +;ROSBOOT_DEBUG_PORT=file +ROSBOOT_DEBUG_PORT=pipe + +; +; ROSBOOT_DEBUG_FILE +; +; This value specifies the debug file. This variable must be set when using +; ROSBOOT_DEBUG_PORT=file +; +; Note: when ROSBOOT_DEBUG_PORT is set to pipe, then sysreg will write all received +; debug data to the specified debug file +; + +;ROSBOOT_DEBUG_FILE=D:\ReactOS\tools\sysreg\bsdebug.log +;ROSBOOT_DEBUG_FILE=D:\ReactOS\tools\sysreg\debug.log + +; ROSBOOT_DELAY_READ; +; +; When the emulator is started, it spends a little time loading and running through its +; BIOS. This time delays reading from the pipe/file untill the specified value +; +; the value is in seconds +; +; Note: if the value is not provided, then reading debug info is started immediately + +ROSBOOT_DELAY_READ=4 + + + +; ROSBOOT_TIME_OUT +; +; This variable is the maximum runtime of the ROSBOOT_CMD. If the command +; runs longer than this value, sysreg exits with success mode; +; +; Note: if you set the variable ROSBOOT_CHECK_POINT and the checkpoint is not reached +; within this time, sysreg exits with failure mode +; +; If the variable is not set, the default timeout is 1 minute +; +ROSBOOT_TIME_OUT=180.0 + +; ROSBOOT_CHECK_POINT +; +; RosBoot will stop executing when it finds a string in the form +; SYSREG_CHECKPOINT:CP_NAME +; +; CP_NAME is the value of the ROSBOOT_CHECK_POINT variable + +ROSBOOT_CHECK_POINT=USETUP_COMPLETE +;ROSBOOT_CHECK_POINT=SYSSETUP_COMPLETE +;ROSBOOT_CHECK_POINT=THIRDBOOT_COMPLETE + +; ROSBOOT_CRITICAL_APP +; +; If an user-mode exception occurs in an critical application, i.e. setup.exe / explorer.exe, sysreg will report +; that the test has failed and quit debugging immediately +; +; if an user-mode exception occurs in any other application, sysreg will report the exception but the exception +; has no effect on the test result +; +; Note: if the value is set to IGNORE, sysreg will ignore all user-mode exceptions +; +; Note: if the variable is not set, then sysreg will stop on the first user-mode exception +; +; seperate each application with an space + + +ROSBOOT_CRITICAL_APP=setup.exe userinit.exe smss.exe winlogon.exe csrss.exe explorer.exe +;ROSBOOT_CRITICAL_APP=setup.exe userinit.exe smss.exe winlogon.exe csrss.exe explorer.exe lsass.exe +