]> git.proxmox.com Git - pmg-api.git/blob - tests/create_testdb.pl
bump version to 5.1-6
[pmg-api.git] / tests / create_testdb.pl
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5 use DBI;
6 use lib '..';
7
8 use PVE::SafeSyslog;
9
10 use PMG::DBTools;
11 use PMG::RuleDB;
12
13 initlog ($0, 'mail');
14
15 my $list = PMG::DBTools::database_list();
16
17 my $dbname = "Proxmox_testdb";
18
19 if ($list->{$dbname}) {
20
21 print "delete existing test database\n";
22 PMG::DBTools::delete_ruledb($dbname);
23 }
24
25 my $dbh = PMG::DBTools::create_ruledb($dbname);
26 my $ruledb = PMG::RuleDB->new($dbh);
27
28 $ruledb->close();
29
30 exit (0);