summaryrefslogtreecommitdiff
path: root/test/get-lists
diff options
context:
space:
mode:
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;