5 my $debug = shift @ARGV;
7 use Test::More tests => 12;
8 use Data::Dump qw/dump/;
14 use_ok('CWMP::Response');
17 ok(my $abs_path = abs_path($0), "abs_path");
18 $abs_path =~ s!/[^/]*$!/!; #!fix-vim
20 ok( my $response = CWMP::Response->new({ debug => $debug }), 'new' );
21 isa_ok( $response, 'CWMP::Response' );
24 my $command = shift || die "no command?";
26 ok( my $xml = $response->$command({ ID => 42 }), "generate response for $command" );
28 my $file = "$abs_path/response/$command.xml";
31 diag "creating $file";
32 write_file( $file, $xml );
35 my $template_xml = read_file( $file ) || die "can't read template xml $file: $!";
37 is( $xml, $template_xml, "compare $command" );
40 check_response( 'InformResponse' );
41 check_response( 'GetRPCMethods' );
42 check_response( 'Reboot' );
43 check_response( 'GetParameterNames' );