Automation testing tools.

This commit is contained in:
Geoffrey Challen
2016-01-11 16:08:40 -05:00
parent 5f05f192de
commit b66416e24f
14 changed files with 872 additions and 3 deletions

View File

@@ -0,0 +1,11 @@
# Makefile for waiter
TOP=../../..
.include "$(TOP)/mk/os161.config.mk"
PROG=waiter
SRCS=waiter.c
BINDIR=/testbin
.include "$(TOP)/mk/os161.prog.mk"

View File

@@ -0,0 +1,29 @@
/*
* waiter.c
*
* Just sits there without doing anything. We use the read system call just to
* provide a way to wait. Intended to test our ability to detect stuck
* processes in userspace.
*/
#include <unistd.h>
#include <err.h>
int
main(void)
{
char ch=0;
int len;
while (ch!='q') {
len = read(STDIN_FILENO, &ch, 1);
if (len < 0) {
err(1, "stdin: read");
}
if (len==0) {
/* EOF */
break;
}
}
return 0;
}