This is the mail archive of the frysk@sources.redhat.com mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] Modify test cases in frysk-core/frysk/proc


Yao Qi wrote:
Hi Yao,
I am so sorry for replying so late to this email. I have been busy with
gui bugs and will be for a couple of more days. I was waiting until mcvet
finished his work on the dedicated ptrace thread, which is now done. I suspect
that we can now enable these tests and fix them (we cannot enable the tests in cvs
if they are failing). I will get to those as soon as I can, but feel free to work on them
if you want.


I am still waiting for that chart of the state machine :)... I want to see what it looks
like :).


Hi, everyone,
Now, some of the test cases in frysk-core/frysk/proc are skipped or
disabled, however, they are useful to verify our new code, so this
patch enables and polishes them.

OK to apply?

2006-06-16 Yao Qi <qiyaoltc@cn.ibm.com>

        * TestTaskSyscallObserver.java : Modify testSyscallOpen.
        * TestI386Regs.java : Enable it.
        * TestI386Modify.java : Ditto.

------------------------------------------------------------------------

Index: frysk-core/frysk/proc/TestI386Modify.java
===================================================================
RCS file: /cvs/frysk/frysk-core/frysk/proc/TestI386Modify.java,v
retrieving revision 1.34
diff -u -r1.34 TestI386Modify.java
--- frysk-core/frysk/proc/TestI386Modify.java 11 Jun 2006 15:11:06 -0000 1.34
+++ frysk-core/frysk/proc/TestI386Modify.java 16 Jun 2006 01:33:24 -0000
@@ -190,12 +190,12 @@
}
}

- boolean skip = true; // XXX
+ boolean skip = false;
public void testI386Modify ()
{
if (skip) {
- System.out.print ("<<SKIPPING>>"); // XXX
+ System.out.print ("<<SKIPPING>>");
return;
}
TestI386ModifyInternals t = new TestI386ModifyInternals ();
Index: frysk-core/frysk/proc/TestI386Regs.java
===================================================================
RCS file: /cvs/frysk/frysk-core/frysk/proc/TestI386Regs.java,v
retrieving revision 1.32
diff -u -r1.32 TestI386Regs.java
--- frysk-core/frysk/proc/TestI386Regs.java 11 Jun 2006 15:11:06 -0000 1.32
+++ frysk-core/frysk/proc/TestI386Regs.java 16 Jun 2006 01:33:25 -0000
@@ -42,6 +42,7 @@
import java.util.Observer;
import java.util.Observable;
+import frysk.sys.SyscallNum;
/**
* Check that I386 registers can be accessed.
*/
@@ -89,7 +90,7 @@
// and sets up the registers with simple values. We want
// to verify that all the registers are as expected.
syscallNum = syscall.number (task);
- if (syscallNum == 1) { + if (syscallNum == SyscallNum.SYSexit) { LinuxIa32 isa = (LinuxIa32)task.getIsa ();
orig_eax = isa.orig_eax.get (task);
ebx = isa.ebx.get (task);
@@ -99,12 +100,20 @@
esi = isa.esi.get (task);
edi = isa.edi.get (task);
esp = isa.esp.get (task);
+ System.out.println("SyscallEnter");
}
return Action.CONTINUE;
}
public Action updateSyscallExit (Task task)
{
- syscallState = 0;
+ SyscallEventInfo syscall + = task.getIsa().getSyscallEventInfo();
+ syscallNum = syscall.number(task);
+
+ if (syscallNum == SyscallNum.SYSexit) {
+ System.out.println("SyscallExit");
+ syscallState = 0;
+ }
return Action.CONTINUE;
}
public Action updateSignaled (Task task, int sig)
@@ -160,7 +169,7 @@
}
- boolean skip = true; // XXX
+ boolean skip = false; // XXX
public void testI386Regs ()
{
Index: frysk-core/frysk/proc/TestTaskSyscallObserver.java
===================================================================
RCS file: /cvs/frysk/frysk-core/frysk/proc/TestTaskSyscallObserver.java,v
retrieving revision 1.5
diff -u -r1.5 TestTaskSyscallObserver.java
--- frysk-core/frysk/proc/TestTaskSyscallObserver.java 15 Jun 2006 19:23:27 -0000 1.5
+++ frysk-core/frysk/proc/TestTaskSyscallObserver.java 16 Jun 2006 01:33:25 -0000
@@ -87,7 +87,7 @@
}
public Action updateSyscallExit (Task task)
{
- if(enter != 0 ) assertTrue ("inSyscall", inSyscall);
+ if(enter != 0) assertTrue ("inSyscall", inSyscall);
inSyscall = false;
exit++;
return Action.CONTINUE;
@@ -107,7 +107,7 @@
}
- // Create an unattached child process.
+ // Create an unattached child process.
AckProcess child = new DetachedAckProcess ();
// Attach to the process using the exec observer. The event
@@ -134,7 +134,7 @@
{
if (skip) {
- System.out.print ("<<BROKEN>>"); // XXX
+ System.out.print ("<<SKIPPING>>");
return;
}
@@ -196,13 +196,11 @@
new StopEventLoopWhenChildProcRemoved ();
child.resume ();
assertRunUntilStop ("run until program exits");
-
assertTrue ("syscall events received >= 8",
syscallObserver.enter >= 8);
//XXX: why ? assertFalse ("syscall events", syscallObserver.inSyscall);
assertTrue ("syscall events", syscallObserver.inSyscall);
}
-
/**
* Need to add task observers to the process the moment it is
* created, otherwize the creation of the very first task is
@@ -259,24 +257,23 @@
{

if (skip) {
- System.out.print ("<<BROKEN>>"); // XXX
+ System.out.print ("<<SKIPPING>>");
return;
}
-
- SyscallOpenObserver syscallOpenObserver = new SyscallOpenObserver ();
- new StopEventLoopWhenChildProcRemoved ();
-
- // Create program making syscalls
+ // Create program making syscalls
AttachedDaemonProcess child = new AttachedDaemonProcess (new String[]
{
getExecPrefix () + "funit-syscalls"
});
+
+ SyscallOpenObserver syscallOpenObserver = new SyscallOpenObserver ();
child.mainTask.requestAddSyscallObserver (syscallOpenObserver);
assertRunUntilStop ("add SyscallObserver");
+ new StopEventLoopWhenChildProcRemoved ();
child.resume ();
assertRunUntilStop ("run \"syscalls\" until exit");
-
+
assertTrue ("syscall events received >= 8",
syscallOpenObserver.enter >= 8); //XXX: why ? assertFalse ("in syscall", syscallOpenObserver.inSyscall);
@@ -284,7 +281,7 @@
assertTrue ("attempt to open a.file",
syscallOpenObserver.testFileOpened);
assertTrue ("open of a.file failed",
- syscallOpenObserver.expectedRcFound);
+ syscallOpenObserver.expectedRcFound); }
/**


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]