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,
+ store => {
+ module => $store_module,
+ path => $store_path,
+ clean => 1,
+ },
}), 'new' );
isa_ok( $server, 'CWMP::Server' );
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",
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",
_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 );