From a0ce96003039d0b59d200c07108156f9f7ff8ade Mon Sep 17 00:00:00 2001 From: rettenbe Date: Tue, 26 Feb 2008 16:39:33 +0000 Subject: [PATCH] debug scripts for sqlite-dbs git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9132 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/tests/sqlite-check-bus.pl | 62 +++++++++++++++++++ gosa-si/tests/sqlite-check-server.pl | 92 ++++++++++++++++++++++++++++ 2 files changed, 154 insertions(+) create mode 100755 gosa-si/tests/sqlite-check-bus.pl create mode 100755 gosa-si/tests/sqlite-check-server.pl diff --git a/gosa-si/tests/sqlite-check-bus.pl b/gosa-si/tests/sqlite-check-bus.pl new file mode 100755 index 000000000..19030d4fe --- /dev/null +++ b/gosa-si/tests/sqlite-check-bus.pl @@ -0,0 +1,62 @@ +#!/usr/bin/perl +#=============================================================================== +# +# FILE: DBD-SQlite.pl +# +# USAGE: ./DBD-SQlite.pl +# +# DESCRIPTION: +# +# OPTIONS: --- +# REQUIREMENTS: --- +# BUGS: --- +# NOTES: --- +# AUTHOR: (), <> +# COMPANY: +# VERSION: 1.0 +# CREATED: 20.12.2007 08:54:52 CET +# REVISION: --- +#=============================================================================== + +use strict; +use warnings; +use GOSA::DBsqlite; + + +print "START\n"; +my $res; +my $db_name; + + + +$db_name = "/var/lib/gosa-si/gosa-si-bus_known_server.db"; +if (-e $db_name) { + print "\n############################################################\n"; +# $db_name =~ /\/([^\/]*?)\.db$/; +# my $table_name = $1; + my $table_name = "bus_known_server"; + print "$db_name\n"; + print "$table_name\n"; + my $sqlite = GOSA::DBsqlite->new($db_name); + my $col_names = $sqlite->get_table_columns($table_name); + print join(', ', @{ $col_names } )."\n" ; + my $answer = $sqlite->show_table($table_name); + print $answer."\n"; +} + +$db_name = "/var/lib/gosa-si/gosa-si-bus_known_clients.db"; +if (-e $db_name) { + print "\n############################################################\n"; +# $db_name =~ /\/([^\/]*?)\.db$/; +# my $table_name = $1; + my $table_name = "bus_known_clients"; + print "$db_name\n"; + print "$table_name\n"; + my $sqlite = GOSA::DBsqlite->new($db_name); + my $col_names = $sqlite->get_table_columns($table_name); + print join(', ', @{ $col_names } )."\n" ; + my $answer = $sqlite->show_table($table_name); + print $answer."\n"; +} + +print "\nFINISH\n"; diff --git a/gosa-si/tests/sqlite-check-server.pl b/gosa-si/tests/sqlite-check-server.pl new file mode 100755 index 000000000..333d93050 --- /dev/null +++ b/gosa-si/tests/sqlite-check-server.pl @@ -0,0 +1,92 @@ +#!/usr/bin/perl +#=============================================================================== +# +# FILE: DBD-SQlite.pl +# +# USAGE: ./DBD-SQlite.pl +# +# DESCRIPTION: +# +# OPTIONS: --- +# REQUIREMENTS: --- +# BUGS: --- +# NOTES: --- +# AUTHOR: (), <> +# COMPANY: +# VERSION: 1.0 +# CREATED: 20.12.2007 08:54:52 CET +# REVISION: --- +#=============================================================================== + +use strict; +use warnings; +use GOSA::DBsqlite; +use Data::Dumper; + +print "START\n"; +my $res; +my $db_name; + + +$db_name = "/var/lib/gosa-si/jobs.db"; +if (-e $db_name) { + print "\n############################################################\n"; + my $table_name = "jobs"; + print "$db_name\n"; + print "$table_name\n"; + my $sqlite = GOSA::DBsqlite->new($db_name); + my $col_names = $sqlite->get_table_columns($table_name); + + print join(', ', @{ $col_names } )."\n" ; + my $answer = $sqlite->show_table($table_name); + print $answer."\n"; +} + + +$db_name = "/var/lib/gosa-si/clients.db"; +if (-e $db_name) { + print "\n############################################################\n"; + my $table_name = "known_clients"; + print "$db_name\n"; + print "$table_name\n"; + + my $sqlite = GOSA::DBsqlite->new($db_name); + my $col_names = $sqlite->get_table_columns($table_name); + print join(', ', @{ $col_names } )."\n" ; + my $answer = $sqlite->show_table($table_name); + print $answer."\n"; +} + + +$db_name = "/var/lib/gosa-si/servers.db"; +if (-e $db_name) { + print "\n############################################################\n"; + my $table_name = "known_server"; + print "$db_name\n"; + print "$table_name\n"; + + my $sqlite = GOSA::DBsqlite->new($db_name); + my $col_names = $sqlite->get_table_columns($table_name); + print join(', ', @{ $col_names } )."\n" ; + my $answer = $sqlite->show_table($table_name); + print $answer."\n"; +} + + +$db_name = "/var/lib/gosa-si/users.db"; +if (-e $db_name) { + print "\n############################################################\n"; + my $table_name = "login_users"; + print "$db_name\n"; + print "$table_name\n"; + + my $sqlite = GOSA::DBsqlite->new($db_name); + my $col_names = $sqlite->get_table_columns($table_name); + print join(', ', @{ $col_names } )."\n" ; + my $answer = $sqlite->show_table($table_name); + print $answer."\n"; +} + + + +print "\nFINISH\n"; -- 2.30.2