added --protocol-dump flag to acs which include part of protocol that we implement
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 28 Oct 2007 21:36:30 +0000 (21:36 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 28 Oct 2007 21:36:30 +0000 (21:36 +0000)
git-svn-id: https://perl-cwmp.googlecode.com/svn/trunk@179 836a5e1a-633d-0410-964b-294494ad4392

bin/acs.pl
lib/Module/Install/PRIVATE.pm

index d8e923d..f143b4c 100755 (executable)
@@ -14,14 +14,41 @@ my $port = 3333;
 my $debug = 0;
 my $store_path = './';
 my $store_plugin = 'YAML';
+my $protocol_dump = 0;
 
 GetOptions(
        'debug+' => \$debug,
        'port=i' => \$port,
        'store-path=s' => \$store_path,
        'store-plugin=s' => \$store_plugin,
+       'protocol-dump!' => \$protocol_dump,
 );
 
+my $queue;
+
+if ( $protocol_dump ) {
+
+       warn "generating dump of xml protocol with CPE\n";
+
+       $queue = [
+                       'GetRPCMethods',
+                       'GetParameterNames',
+#                      [ 'GetParameterNames', 'InternetGatewayDevice.DeviceInfo.SerialNumber', 0 ],
+#                      [ 'GetParameterNames', 'InternetGatewayDevice.DeviceInfo.', 1 ],
+                       [ 'GetParameterValues',
+                               'InternetGatewayDevice.DeviceInfo.SerialNumber',
+                               'InternetGatewayDevice.DeviceInfo.VendorConfigFile.',
+                               'InternetGatewayDevice.DeviceInfo.X_000E50_Country',
+                       ],
+                       [ 'SetParameterValues',
+                               'InternetGatewayDevice.DeviceInfo.ProvisioningCode' => 'test provision',
+#                      'InternetGatewayDevice.DeviceInfo.X_000E50_Country' => 1,
+                       ],
+#                      'Reboot',
+       ];
+};
+
+
 my $server = CWMP::Server->new({
        port => $port,
        store => {
@@ -30,22 +57,7 @@ my $server = CWMP::Server->new({
                debug => $debug,
        },
        debug => $debug,
-       default_queue => [
-               'GetRPCMethods',
-               'GetParameterNames',
-#              [ 'GetParameterNames', 'InternetGatewayDevice.DeviceInfo.SerialNumber', 0 ],
-#              [ 'GetParameterNames', 'InternetGatewayDevice.DeviceInfo.', 1 ],
-               [ 'GetParameterValues',
-                       'InternetGatewayDevice.DeviceInfo.SerialNumber',
-                       'InternetGatewayDevice.DeviceInfo.VendorConfigFile.',
-                       'InternetGatewayDevice.DeviceInfo.X_000E50_Country',
-               ],
-               [ 'SetParameterValues',
-                       'InternetGatewayDevice.DeviceInfo.ProvisioningCode' => 'test provision',
-#                      'InternetGatewayDevice.DeviceInfo.X_000E50_Country' => 1,
-               ],
-#              'Reboot',
-       ],
+       default_queue => [ $queue ],
 });
 $server->run();
 
index 3ac2730..fa466ca 100644 (file)
@@ -27,7 +27,7 @@ sub my_targets {
 
 dump: all
        rm dump/* || true
-       ./bin/acs.pl -d -d -d 2>&1 | tee log
+       ./bin/acs.pl -d -d -d --protocol-dump 2>&1 | tee log
 
 html: \$(MAN1PODS) \$(MAN3PODS)
        test -d html || mkdir html