Merge branch 'master' of ssh://git.rot13.org/git/perl-cwmp
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 8 Mar 2010 14:00:50 +0000 (15:00 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 8 Mar 2010 14:00:50 +0000 (15:00 +0100)
lib/CWMP/Session.pm
scripts/zte-configure-acs.pl [new file with mode: 0755]

index ab65e4d..4ce8a07 100644 (file)
@@ -79,7 +79,7 @@ sub vendor_hook {
        my @refresh;
 
        foreach my $n ( keys %$vendor_data ) {
-               if ( $vendor_data->{$n} ne $stored->{$n} ) {
+               if ( defined $stored->{$n} && $vendor_data->{$n} ne $stored->{$n} ) {
                        next if $set_tried->{$uid}->{$n}++;
                        push @refresh, $n;
                        $queue->enqueue( 'SetParameterValues', { $n => $vendor_data->{$n} } );
diff --git a/scripts/zte-configure-acs.pl b/scripts/zte-configure-acs.pl
new file mode 100755 (executable)
index 0000000..65ee54a
--- /dev/null
@@ -0,0 +1,43 @@
+#!/usr/bin/perl
+
+use warnings;
+use strict;
+
+my $acs = 'http://192.168.2.100:3333';
+my $cpe = 'http://192.168.2.1';
+
+use WWW::Mechanize;
+my $mech = WWW::Mechanize->new();
+
+$mech->get( $cpe );
+
+$mech->submit_form(
+       form_number => 1,
+       fields => {
+               tUsername => 'admin',
+               tPassword => 'admin',
+       }
+);
+
+$mech->follow_link( text_regex => qr/Advanced/ );
+
+$mech->follow_link( text_regex => qr/TR069/ );
+
+#$mech->dump_forms;
+#$mech->dump_links;
+#$mech->dump_all;
+
+my $uid = 'time-' . time();
+
+$mech->submit_form(
+       form_number => 2,
+       fields => {
+               _ACS_URL => $acs,
+               _ACS_NAME => $uid,
+               _ENABLE => '_ENABLE',
+       }
+);
+
+
+warn $uid;
+