25 |
ok(my $abs_path = abs_path($0), "abs_path"); |
ok(my $abs_path = abs_path($0), "abs_path"); |
26 |
$abs_path =~ s!/[^/]*$!/!; #!fix-vim |
$abs_path =~ s!/[^/]*$!/!; #!fix-vim |
27 |
|
|
28 |
my $store_path = "$abs_path/var/state.db"; |
my $store_path = "$abs_path/var/"; |
29 |
unlink $store_path if -e $store_path; |
#my $store_module = 'DBMDeep'; |
30 |
|
my $store_module = 'YAML'; |
31 |
|
|
32 |
ok( my $server = CWMP::Server->new({ |
ok( my $server = CWMP::Server->new({ |
33 |
debug => $debug, |
debug => $debug, |
34 |
port => $port, |
port => $port, |
35 |
store_path => $store_path, |
store => { |
36 |
|
module => $store_module, |
37 |
|
path => $store_path, |
38 |
|
clean => 1, |
39 |
|
}, |
40 |
}), 'new' ); |
}), 'new' ); |
41 |
isa_ok( $server, 'CWMP::Server' ); |
isa_ok( $server, 'CWMP::Server' ); |
42 |
|
|
157 |
|
|
158 |
sleep 1; |
sleep 1; |
159 |
|
|
160 |
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' ); |
161 |
|
|
162 |
my $state = { |
my $state = { |
163 |
CurrentTime => "1970-01-01T00:04:33Z", |
CurrentTime => "1970-01-01T00:04:33Z", |
189 |
_dispatch => "InformResponse", |
_dispatch => "InformResponse", |
190 |
}; |
}; |
191 |
|
|
192 |
is_deeply( $store->state( ID => '1_THOM_TR69_ID' ), $state, 'new store->state' ); |
is_deeply( $store->get_state( ID => '1_THOM_TR69_ID' ), $state, 'new store->get_state' ); |
193 |
|
|
194 |
ok( kill(9,$pid), 'kill ' . $pid ); |
ok( kill(9,$pid), 'kill ' . $pid ); |
195 |
|
|