projects
/
perl-cwmp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r238@brr: dpavlin | 2007-11-18 18:32:08 +0100
[perl-cwmp.git]
/
t
/
30-server.t
diff --git
a/t/30-server.t
b/t/30-server.t
index
b82d1e2
..
5926000
100755
(executable)
--- 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
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,
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' );
}), 'new' );
isa_ok( $server, 'CWMP::Server' );
@@
-152,7
+160,7
@@
ok( $s->write_chunk_eof, 'write_chunk_eof' );
sleep 1;
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",
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,
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",
Parameter => {
"\nInternetGatewayDevice.DeviceInfo.SpecVersion" => "1.1",
".ExternalIPAddress" => "192.168.1.254",
@@
-184,8
+192,11
@@
my $state = {
_dispatch => "InformResponse",
};
_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' );
ok( kill(9,$pid), 'kill ' . $pid );
ok( waitpid($pid,0), 'waitpid' );
+