Changeset 24372 for trunk/Nebulous-Server/lib/Test
- Timestamp:
- Jun 10, 2009, 3:30:24 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous-Server/lib/Test/Nebulous.pm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/lib/Test/Nebulous.pm
r19493 r24372 11 11 use base qw( Exporter ); 12 12 13 use Cache::Memcached; 13 14 use DBI; 14 15 use File::Path qw( mkpath rmtree ); … … 16 17 use Nebulous::Server::SQL; 17 18 18 our @EXPORT = qw( $NEB_DB $NEB_USER $NEB_PASS );19 our @EXPORT = qw( $NEB_DB $NEB_USER $NEB_PASS $NEB_MEMCACHED_SERVERS); 19 20 20 21 our $NEB_DB = $ENV{'NEB_DB'} || "DBI:mysql:database=test:host=localhost"; 21 22 our $NEB_USER = $ENV{'NEB_USER'} || "test"; 22 23 our $NEB_PASS = $ENV{'NEB_PASS'} || ''; 24 our $NEB_MEMCACHED_SERVERS = ['127.0.0.1:11211']; 23 25 24 26 my $dbh = DBI->connect( $NEB_DB, $NEB_USER, $NEB_PASS ); … … 83 85 84 86 sub cleanup { 87 # memcached needs to be emptied between test runs 88 Cache::Memcached->new(servers => $NEB_MEMCACHED_SERVERS)->flush_all; 89 # if flush_all() turns out to be useless as feared 90 # my $memd = Cache::Memcached->new(servers => $NEB_MEMCACHED_SERVERS); 91 # my $query = $dbh->prepare("SELECT ext_id FROM storage_object"); 92 # if ($query->execute) { 93 # while (my $row = $query->fetchrow_hashref) { 94 # my $ext_id = $row->{ext_id}; 95 # warn "found key $ext_id\n" if $memd->get($ext_id); 96 # warn "deleted $ext_id\n" if $memd->delete($ext_id); 97 # } 98 # } 99 # $query->finish; 100 85 101 foreach my $statement (@{ $sql->get_db_clear }) { 86 102 $dbh->do( $statement );
Note:
See TracChangeset
for help on using the changeset viewer.
