[Libsysio-commit] namespace_assembly: libsysio/tests test_namespace.c
Brought to you by:
lward
|
From: Sonja T. <so...@us...> - 2004-01-30 21:56:03
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25378/tests Modified Files: Tag: namespace_assembly test_namespace.c Log Message: Cleaned up namespace_assembly code. Accepts commands with arbitrary ws in them. Also moved 'put' command to just be a part of the creat command Index: test_namespace.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/Attic/test_namespace.c,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -w -b -B -p -r1.1.2.2 -r1.1.2.3 --- test_namespace.c 12 Jan 2004 15:50:08 -0000 1.1.2.2 +++ test_namespace.c 30 Jan 2004 21:54:22 -0000 1.1.2.3 @@ -3,6 +3,7 @@ * specification. Ensures that it can then do stuff with * environment */ +#include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> @@ -10,6 +11,7 @@ #include <string.h> +#include "test.h" #include "sysio.h" #include "namespace.h" @@ -27,7 +29,7 @@ int usage() */ char *envname = "NAMESPACE"; -char *cmdseq = "{mnt,dev=incore:\"0777+0+0\",dir=/}{creat,ft=dir,nm=/proc,pm=0777}{creat,ft=dir,nm=/proc/self,pm=0777}{creat,ft=dir,nm=/proc/self/fd,pm=0777}{creat,ft=chr,nm=/proc/self/fd/stdin,pm=0400,mm=0+0}{creat,ft=chr,nm=/proc/self/fd/stdout,pm=0200,mm=0+1}{creat,ft=chr,nm=/proc/self/fd/stderr,pm=0200,mm=0+2}{init,dn=native}{creat,ft=dir,nm=/tmp,pm=0777}{mnt,dev=native:/tmp,dir=/tmp}{creat,ft=file,nm=/tmp/.mount,pm=0777}{put,str=\"native:/home\",src=/tmp/.mount}{chmd,src=/tmp/.mount,pm=0400}"; +char *cmdseq = "{mnt, dev=incore:\"0777+0+0\",dir=/ } {creat,\n\nft=dir,nm=/proc,pm=0777}{creat,ft=dir,nm=/proc/self,pm=0777}{creat,ft=dir,nm=/proc/self/fd,pm=0777}{creat,ft=chr, nm=/proc/self/fd/stdin,pm=0400 ,mm=0+0}{creat,ft=chr,nm=/proc/self/fd/stdout,pm=0200, mm=0+1}{creat, ft=chr,nm=/proc/self/fd/stderr,pm=0200,mm=0+2}{init,dn=native}{creat,\nft=dir,nm=/tmp,pm=0777}{mnt,dev=native:/tmp,dir=/tmp}{creat, ft=file,nm=/tmp/.mount,pm=0777, str=\"native:/home\n\", str=\"Put this \n mult-line meaningless trite with random \\\"\\\" quotes in it\"}{chmd,src=/tmp/.mount,pm=0400}"; @@ -115,14 +117,6 @@ int main(int argc, char** argv) exit(1); } - if (usecmdseq) { - /* Cleanup the .mount file */ - if (unlink("/tmp/.mount") != 0) { - printf("Unlink of .mount failed with %s\n", strerror(errno)); - exit(1); - } - } - printf("Namespace tested completed successfully\n"); exit(0); } |