my $debug = 1;
my $protocol_dump = 0;
my $list = 0;
+my $introspect = 0;
GetOptions(
'debug+' => \$debug,
'protocol-dump!' => \$protocol_dump,
'list!' => \$list,
+ 'introspect!' => \$introspect,
);
-die "usage: $0 CPE_id [--protocol-dump]\n" unless @ARGV;
+die "usage: $0 [...queue/]CPE_id [ --list | --introspect | --protocol-dump ]\n" unless @ARGV;
foreach my $id ( @ARGV ) {
print "Active jobs [", scalar @active, "]\n",join("\n\n", @active) if @active;
print "Queued jobs [", scalar @queued, "]\n",join("\n\n", @queued) if @queued;
- } else {
+ } elsif ( $introspect ) {
- warn "injecting some tests commands\n";
+ $q->enqueue( 'GetRPCMethods' ); # XXX not supported by ZTE
- $q->enqueue( 'GetRPCMethods' );
+ $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.', 1 ] );
- # $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.LANDevice.', 1 ] );
+# $q->enqueue( 'GetRPCMethods' ); # XXX not supported by ZTE
+
+ $q->enqueue( 'GetParameterValues', [
+ 'InternetGatewayDevice.',
+ ]);
- # $q->enqueue( 'GetParameterValues', [
- # 'InternetGatewayDevice.',
- # ]);
- # $q->enqueue( 'GetParameterNames', [ '.ExternalIPAddress', 1 ] );
+# $q->enqueue( 'GetParameterNames', [ '.ExternalIPAddress', 1 ] );
- # $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.', 1 ] );
- # $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.DeviceInfo.', 1 ] );
- # $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.DeviceConfig.', 1 ] );
- # $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.ManagementServer.', 1 ] );
- # $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.Services.', 1 ] );
- # $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.LANDevice.', 1 ] );
+ $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.', 1 ] );
+# $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.DeviceInfo.', 1 ] );
+# $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.DeviceConfig.', 1 ] );
+# $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.ManagementServer.', 1 ] );
+# $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.Services.', 1 ] );
+# $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.LANDevice.', 1 ] );
$q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.', 0 ] );
$q->enqueue( 'GetParameterValues', [
- 'InternetGatewayDevice.',
+ #'InternetGatewayDevice.', # too big for ZTE
+ 'InternetGatewayDevice.DeviceConfig.',
+ 'InternetGatewayDevice.DeviceInfo.',
+ 'InternetGatewayDevice.DeviceSummary',
+ 'InternetGatewayDevice.ManagementServer.',
]);
+ $q->enqueue( 'GetParameterValues' => [ $_ ] ) foreach ( qw/
+InternetGatewayDevice.IPPingDiagnostics.
+InternetGatewayDevice.LANConfigSecurity.
+InternetGatewayDevice.LANDevice.
+InternetGatewayDevice.Layer2Bridging.
+InternetGatewayDevice.Layer3Forwarding.
+InternetGatewayDevice.ManagementServer.
+InternetGatewayDevice.QueueManagement.
+InternetGatewayDevice.Time.
+InternetGatewayDevice.UserInterface.
+InternetGatewayDevice.WANDevice.
+ / );
+
$q->enqueue( 'GetParameterAttributes', [
'InternetGatewayDevice.DeviceInfo.SerialNumber',
+ 'InternetGatewayDevice.DeviceInfo.SoftwareVersion',
]);
# $q->enqueue( 'SetParameterAttributes', [ '
+
+ } else {
+
+ warn "injecting some tests commands\n";
+
+ # turn on periodic reporting to ACS server
+
+# $q->enqueue( 'GetParameterValues', [ 'InternetGatewayDevice.ManagementServer.' ] );
+ $q->enqueue( 'SetParameterValues', {
+ 'InternetGatewayDevice.DeviceInfo.ProvisioningCode' => 'perl-cwmp provision',
+ } );
+ $q->enqueue( 'SetParameterValues', {
+ 'InternetGatewayDevice.ManagementServer.PeriodicInformInterval' => 15, # s
+ } );
+ $q->enqueue( 'SetParameterValues', {
+ 'InternetGatewayDevice.ManagementServer.PeriodicInformEnable' => 1,
+ } );
+
+ $q->enqueue( 'GetParameterValues', [
+ 'InternetGatewayDevice.ManagementServer.',
+ 'InternetGatewayDevice.DeviceInfo.ProvisioningCode',
+ ] );
+
}
}