1#
2# id.test
3#
4# Tests for the id command.
5#---------------------------------------------------------------------------
6# Copyright 1992-1999 Karl Lehenbauer and Mark Diekhans.
7#
8# Permission to use, copy, modify, and distribute this software and its
9# documentation for any purpose and without fee is hereby granted, provided
10# that the above copyright notice appear in all copies.  Karl Lehenbauer and
11# Mark Diekhans make no representations about the suitability of this
12# software for any purpose.  It is provided "as is" without express or
13# implied warranty.
14#------------------------------------------------------------------------------
15# $Id: id.test,v 1.2 2002/04/02 02:29:43 hobbs Exp $
16#------------------------------------------------------------------------------
17#
18
19# FIX: These are very basic tests.  Better are needed.
20
21if {[cequal [info procs Test] {}]} {
22    source [file join [file dirname [info script]] testlib.tcl]
23}
24
25if [cequal $tcl_platform(platform) windows] {
26    echo "    * The id command tests have not been ported to Win32" 
27    return
28}
29
30Test id-1.1 {id arg checking} {
31    id
32} 1 {wrong # args: id arg ?arg...?}
33
34Test id-1.2 {id arg checking} {
35    id x
36} 1 {second arg must be one of "convert", "effective", "process", "user", "userid", "group", "groupid", "groups", "groupids", or "host"}
37
38
39Test id-2.1 {id convert arg checking} {
40    id convert x
41} 1 {wrong # args: id convert type value}
42
43Test id-2.2 {id convert arg checking} {
44    id convert x y
45} 1 {third arg must be "user", "userid", "group" or "groupid", got "x"}
46
47Test id-3.1 {id convert} {
48    id convert user root
49} 0 {0}
50
51Test id-4.2 {id convert} {
52    id convert userid 0
53} 0 {root}
54
55# FIX: Add  "group" or "groupid"
56
57# FIX: ADD:
58#     effective
59#     process
60#     user
61#     userid
62#     group
63#     groupid
64#     groups
65#     groupids
66#     host
67
68# FIX: Make sure this doesn't core dump./
69id groups
70
71# cleanup
72::tcltest::cleanupTests
73return
74