1996-12-18 15:36:34 -04:00
|
|
|
#! /usr/bin/env python
|
|
|
|
"""Test script for the grp module
|
|
|
|
Roger E. Masse
|
|
|
|
"""
|
1996-12-20 18:36:52 -04:00
|
|
|
|
1996-12-18 15:36:34 -04:00
|
|
|
import grp
|
1996-12-20 18:36:52 -04:00
|
|
|
from test_support import verbose
|
1996-12-18 15:36:34 -04:00
|
|
|
|
|
|
|
groups = grp.getgrall()
|
|
|
|
if verbose:
|
|
|
|
print 'Groups:'
|
|
|
|
for group in groups:
|
|
|
|
print group
|
|
|
|
|
|
|
|
|
|
|
|
group = grp.getgrgid(groups[0][2])
|
|
|
|
if verbose:
|
|
|
|
print 'Group Entry for GID %d: %s' % (groups[0][2], group)
|
|
|
|
|
|
|
|
group = grp.getgrnam(groups[0][0])
|
|
|
|
if verbose:
|
|
|
|
print 'Group Entry for group %s: %s' % (groups[0][0], group)
|