From e42ed5864e130b0c477c432205435b14460b1664 Mon Sep 17 00:00:00 2001 From: chetz Date: Mon, 9 Aug 2004 08:38:48 +0000 Subject: [PATCH] *** empty log message *** --- scsh/test/user-and-group-db-access.scm | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 scsh/test/user-and-group-db-access.scm diff --git a/scsh/test/user-and-group-db-access.scm b/scsh/test/user-and-group-db-access.scm new file mode 100644 index 0000000..4b986c8 --- /dev/null +++ b/scsh/test/user-and-group-db-access.scm @@ -0,0 +1,36 @@ +;;; Test for the functions in section 3.6 of the scsh-manual "user and group database access" +;;; Author: Christoph Hetz + +;; for testing: (certainly the path will be an other on other systems...) + +;; ,open define-record-types handle +;; ,config ,load C:/cygwin/home/mephisto/cvs_scsh/scsh/scsh/test/test-packages.scm +;; ,load C:/cygwin/home/mephisto/cvs_scsh/scsh/scsh/test/test-base.scm +;; load this file +;; (test-all) + +;; *** tests *** + +(add-test! 'user-info 'user-and-group-db-access + (lambda () + (let* ((user-0 (user-info (getenv "USER"))) + (user-name (user-info:name user-0)) + (user-id (user-info:uid user-0)) + (user-gid (user-info:gid user-0)) + (user-hdir (user-info:home-dir user-0)) + (user-shell (user-info:shell user-0)) + (group-0 (group-info user-gid)) + (group-name (group-info:name group-0)) + (group-id (group-info:gid group-0)) + (group-mem (group-info:members group-0))) + (and (string? user-name) + (integer? user-id) + (integer? user-gid) + (string? user-hdir) + (string? user-shell) + (string? group-name) + (integer? group-id) + (list? group-mem) + (equal? user-name (user-info:name (user-info user-id))) + (equal? (user-info (getenv "USER")) (user-info:name (user-info user-id))) + (equal? group-id (group-info:gid (group-info group-name))))))) \ No newline at end of file