X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=t%2F30-server.t;h=5926000cf518d15e748b7e2ee0d9b5451c43d4da;hb=71970361377c34791fd6e7970a32fd2ba345d8bc;hp=b82d1e22517e0dbde48460137562bcf34b4945ce;hpb=8ddfa88afea617dc8546f10313026d51fb79a926;p=perl-cwmp.git diff --git a/t/30-server.t b/t/30-server.t index b82d1e2..5926000 100755 --- a/t/30-server.t +++ b/t/30-server.t @@ -25,13 +25,21 @@ eval { ok(my $abs_path = abs_path($0), "abs_path"); $abs_path =~ s!/[^/]*$!/!; #!fix-vim -my $store_path = "$abs_path/var/state.db"; -unlink $store_path if -e $store_path; +my $store_path = "$abs_path/var/"; +#my $store_module = 'DBMDeep'; +my $store_module = 'YAML'; ok( my $server = CWMP::Server->new({ debug => $debug, port => $port, - store_path => $store_path, + session => { + store => { + module => $store_module, + path => $store_path, + clean => 1, + }, + create_dump => 0, + } }), 'new' ); isa_ok( $server, 'CWMP::Server' ); @@ -152,7 +160,7 @@ ok( $s->write_chunk_eof, 'write_chunk_eof' ); sleep 1; -ok( my $store = CWMP::Store->new({ path => $store_path, debug => $debug }), 'another store' ); +ok( my $store = CWMP::Store->new({ module => $store_module, path => $store_path, debug => $debug }), 'another store' ); my $state = { CurrentTime => "1970-01-01T00:04:33Z", @@ -165,7 +173,7 @@ my $state = { EventStruct => ["0 BOOTSTRAP", "1 BOOT", "4 VALUE CHANGE"], ID => "1_THOM_TR69_ID", MaxEnvelopes => 2, - NoMoreRequests => undef, +# NoMoreRequests => undef, Parameter => { "\nInternetGatewayDevice.DeviceInfo.SpecVersion" => "1.1", ".ExternalIPAddress" => "192.168.1.254", @@ -184,8 +192,11 @@ my $state = { _dispatch => "InformResponse", }; -is_deeply( $store->state( ID => '1_THOM_TR69_ID' ), $state, 'new store->state' ); +is_deeply( $store->current_store->get_state( 'CP0644JTHJ4' ), $state, 'store->current_store->get_state' ); + +diag "shutdown server"; ok( kill(9,$pid), 'kill ' . $pid ); ok( waitpid($pid,0), 'waitpid' ); +