projects
/
perl-cwmp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix server test to use new current_store accessor to store plugin
[perl-cwmp.git]
/
t
/
30-server.t
diff --git
a/t/30-server.t
b/t/30-server.t
index
b82d1e2
..
d8bcbd4
100755
(executable)
--- a/
t/30-server.t
+++ b/
t/30-server.t
@@
-25,13
+25,18
@@
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,
+ store => {
+ module => $store_module,
+ path => $store_path,
+ clean => 1,
+ },
}), 'new' );
isa_ok( $server, 'CWMP::Server' );
}), 'new' );
isa_ok( $server, 'CWMP::Server' );
@@
-152,7
+157,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
+170,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,7
+189,7
@@
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' );
ok( kill(9,$pid), 'kill ' . $pid );
ok( kill(9,$pid), 'kill ' . $pid );