summaryrefslogtreecommitdiff
path: root/test/get-lists
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2015-09-30 23:05:11 (GMT)
committerChristian Pointner <equinox@spreadspace.org>2015-09-30 23:05:11 (GMT)
commit6f1943313a0e503189dd9685483a9ecd1bd7cc6e (patch)
tree7461bd743125feb61a7f977a06e7698bb184d333 /test/get-lists
parent88ba274e7841fedffe9ef98b0933c0610ac6997c (diff)
introduced rhrd context
Diffstat (limited to 'test/get-lists')
-rwxr-xr-xtest/get-lists14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/get-lists b/test/get-lists
index 47d6dfd..2f7be2b 100755
--- a/test/get-lists
+++ b/test/get-lists
@@ -24,13 +24,13 @@ use strict;
use lib "../lib/";
use RHRD::rddb;
-my ($dbh, undef, $errorstring) = RHRD::rddb::opendb();
-if(defined $dbh) {
+my ($ctx, undef, $errorstring) = RHRD::rddb::init();
+if(defined $ctx) {
print "Users:\n";
- my @users = RHRD::rddb::list_users($dbh);
+ my @users = RHRD::rddb::list_users($ctx);
if(!defined $users[0] && defined $users[1]) {
print STDERR "$users[1]: $users[2]";
- RHRD::rddb::closedb($dbh);
+ RHRD::rddb::destroy($ctx);
exit 1;
}
for my $user (@users) {
@@ -38,17 +38,17 @@ if(defined $dbh) {
}
print "\nGroups:\n";
- my @groups = RHRD::rddb::list_groups($dbh);
+ my @groups = RHRD::rddb::list_groups($ctx);
if(!defined $groups[0] && defined $groups[1]) {
print STDERR "$groups[1]: $groups[2]";
- RHRD::rddb::closedb($dbh);
+ RHRD::rddb::destroy($ctx);
exit 1;
}
for my $group (@groups) {
print " " . $group . "\n";
}
- RHRD::rddb::closedb($dbh);
+ RHRD::rddb::destroy($ctx);
} else {
print "$errorstring\n";
exit 1;