summaryrefslogtreecommitdiffstats
path: root/config-db
diff options
context:
space:
mode:
authorOliver Tappe2006-10-02 19:34:36 +0200
committerOliver Tappe2006-10-02 19:34:36 +0200
commitf012bf34e1589ee0bf7cc47bf56fd6ff5c6b3f2f (patch)
tree49a2830de7936d8b092d9be7d43124eabe1cb18c /config-db
parentTFTP prefix not really needed in stage3 (sorry for hassles! made tests (diff)
downloadcore-f012bf34e1589ee0bf7cc47bf56fd6ff5c6b3f2f.tar.gz
core-f012bf34e1589ee0bf7cc47bf56fd6ff5c6b3f2f.tar.xz
core-f012bf34e1589ee0bf7cc47bf56fd6ff5c6b3f2f.zip
* added support for --help, --man and --version
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@423 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'config-db')
-rwxr-xr-xconfig-db/setup-test-data-simple.pl208
1 files changed, 205 insertions, 3 deletions
diff --git a/config-db/setup-test-data-simple.pl b/config-db/setup-test-data-simple.pl
index b6a68576..3b5e9531 100755
--- a/config-db/setup-test-data-simple.pl
+++ b/config-db/setup-test-data-simple.pl
@@ -8,13 +8,30 @@ use OpenSLX::Basics;
use OpenSLX::ConfigDB qw(:access :manipulation);
use Getopt::Long qw(:config pass_through);
-my $clobber;
+use Pod::Usage;
+
+my (
+ $clobber,
+ $helpReq,
+ $manReq,
+ $versionReq,
+);
+
GetOptions(
- 'clobber' => \$clobber
+ 'clobber' => \$clobber,
# clobber causes this script to overwrite the database without asking
+ 'help|?' => \$helpReq,
+ 'man' => \$manReq,
+ 'version' => \$versionReq,
);
+pod2usage(1) if $helpReq;
+pod2usage(-verbose => 2) if $manReq;
+if ($versionReq) {
+ system('slxversion');
+ exit 1;
+}
-openslxInit();
+openslxInit() or pod2usage(2);
my $openslxDB = connectConfigDB();
@@ -102,3 +119,188 @@ addSystemIDsToClient($openslxDB, $client1Id, [$system1Id, $system2Id]);
addSystemIDsToClient($openslxDB, $client2Id, [$system2Id]);
disconnectConfigDB($openslxDB);
+
+__END__
+
+=head1 NAME
+
+slxsetup-test-data-simple.pl - Simple OpenSLX test data generator
+
+=head1 SYNOPSIS
+
+slxsetup-test-data-simple.pl [options]
+
+ Specific Options:
+ --clobber overwrites config-db without asking
+
+ OpenSLX Options:
+ --db-basepath=s basic path to openslx database
+ --db-datadir=s data folder created under db-basepath
+ --db-spec=s full DBI-specification of database
+ --db-name=s name of database
+ --db-type=s type of database to connect to
+ --locale=s locale to use for translations
+ --logfile=s file to write logging output to
+ --bin-path=s path to binaries and scripts
+ --config-path=s path to configuration files
+ --base-path=s basic path to project files
+ --export-path=s path to root of all exported filesystems
+ --private-path=s path to private data
+ --public-path=s path to public (client-accesible) data
+ --share-path=s path to sharable data
+ --temp-path=s path to temporary data
+ --tftpboot-path=s path to root of tftp-server
+ --verbose-level=i level of logging verbosity (0-3)
+
+ General Options:
+ --help brief help message
+ --man full documentation
+
+=head1 OPTIONS
+
+=head2 Script Options
+
+=over 8
+
+=item B<--clobber>
+
+Runs the script without asking any questions, B<any contents in the OpenSLX
+config-db will be wiped!>
+
+=back
+
+=head2 OpenSLX Options
+
+=over 8
+
+=item B<--base-path=s>
+
+Sets basic path to project files.
+
+Default is $SLX_BASE_PATH (usually F</opt/openslx>).
+
+=item B<--bin-path=s>
+
+Sets path to binaries and scripts.
+
+Default is $SLX_BASE_PATH/bin (usually F</opt/openslx/bin>).
+
+=item B<--config-path=s>
+
+Sets path to configuration files.
+
+Default is $SLX_CONFIG_PATH (usually F</etc/opt/openslx>).
+
+=item B<--db-basepath=s>
+
+Sets basic path to openslx database.
+
+Default is $SLX_DB_PATH (usually F</var/opt/openslx/db>).
+
+=item B<--db-datadir=s>
+
+Sets data folder created under db-basepath.
+
+Default is $SLX_DB_DATADIR (usually empty as it depends on db-type
+whether or not such a directory is required at all).
+
+=item B<--db-name=s>
+
+Gives the name of the database to connect to.
+
+Default is $SLX_DB_NAME (usually C<openslx>).
+
+=item B<--db-spec=s>
+
+Gives the full DBI-specification of database to connect to. Content depends
+on the db-type.
+
+Default is $SLX_DB_SPEC (usually empty as it will be built automatically).
+
+=item B<--db-type=s>
+
+Sets the type of database to connect to (CSV, SQLite, mysql, ...).
+
+Default $SLX_DB_TYPE (usually C<CSV>).
+
+=item B<--export-path=s>
+
+Sets path to root of all exported filesystems. For each type of export (NFS,
+NBD, ...) a separate folder will be created in here.
+
+Default is $SLX_EXPORT_PATH (usually F</srv/openslx/export>.
+
+=item B<--locale=s>
+
+Sets the locale to use for translations.
+
+Defaults to the system's standard locale.
+
+=item B<--logfile=s>
+
+Specifies a file where logging output will be written to.
+
+Default is to log to STDERR.
+
+=item B<--private-path=s>
+
+Sets path to private data, where the config-db, vendor_oses and configurational
+extensions will be stored.
+
+Default is $SLX_PRIVATE_PATH (usually F</var/opt/openslx>.
+
+=item B<--public-path=s>
+
+Sets path to public (client-accesible) data.
+
+Default is $SLX_PUBLIC_PATH (usually F</srv/openslx>.
+
+=item B<--share-path=s>
+
+Sets path to sharable data, where distro-specs and functionality templates
+will be stored.
+
+Default is $SLX_SHARE_PATH (usually F</opt/openslx/share>.
+
+=item B<--temp-path=s>
+
+Sets path to temporary data.
+
+Default is $SLX_TEMP_PATH (usually F</tmp>.
+
+=item B<--tftpboot-path=s>
+
+Sets path to root of tftp-server from which clients will access their files.
+
+Default is $SLX_TFTPBOOT_PATH (usually F</srv/openslx/tftpboot>.
+
+=item B<--verbose-level=i>
+
+Sets the level of logging verbosity (0-3).
+
+Default is $SLX_VERBOSE_LEVEL (usually 0, no logging).
+
+=back
+
+=head2 General Options
+
+=over 8
+
+=item B<--help>
+
+Prints a brief help message and exits.
+
+=item B<--man>
+
+Prints the manual page and exits.
+
+=back
+
+=head1 DESCRIPTION
+
+B<slxsetup-test-data-simple.pl> will generate a very simple test-dataset
+useful for testing and/or trying things out.
+
+If the OpenSLX configuration database already contains data, the script
+asks for confirmation before clobbering that database.
+