Changeset 3072 in /cluster/svnroot


Ignore:
Timestamp:
Mar 20, 2011 3:03:46 PM (10 years ago)
Author:
leemasa
Message:

re #524:
Added support for automatic shutdown w/o password, added code to automatically shut down after test suite
Made a file, /bccd_boot_flags that populates with boot flags from the NIC on startup. Now accessing boot flags is as simple as source /bccd_boot_flags.

Location:
bccd-ng/branches/sam-test_fw
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • bccd-ng/branches/sam-test_fw/bin/build_livecd.pl

    r3007 r3072  
    325325          "nsswitch.conf", "unionfs.conf", "X11/xinit/xinitrc", "X11/xinit/xserverrc",
    326326          "dpkg/dpkg.cfg", "ld.so.conf.d/software.conf", "sudoers", "init.d/bccd-networking",
    327           "init.d/bccd-passwd", "init.d/bccd-dhcp", "init.d/bccd-sshd", "X11/xorg.conf",
     327                  "init.d/bccd-bootflags", "init.d/bccd-auotmated", "init.d/bccd-passwd",
     328                   "init.d/bccd-dhcp", "init.d/bccd-sshd", "X11/xorg.conf",
    328329          "lam.conf", "init.d/bccd-nfs", "init.d/bccd-unite-sw", "init.d/bccd-nics",
    329330          "init.d/bccd-dhcp-conf", "init.d/bccd-route", "init.d/bccd-keyboard", "rc.local",
     
    348349
    349350foreach my $file ( "bccd-networking", "bccd-passwd", "bccd-dhcp", "bccd-sshd", "bccd-nfs", "bccd-unite-sw",
    350           "bccd-nics", "bccd-dhcp-conf", "bccd-route", "bccd-keyboard", "bccd-fsrw", "bccd-mail" ) {
     351          "bccd-nics", "bccd-dhcp-conf", "bccd-route", "bccd-keyboard", "bccd-fsrw", "bccd-mail", "bccd-bootflags", "bccd-automated" ) {
    351352    $Bccd->run_test(
    352353        "chmod",
     
    737738
    738739# This must run before 20 (bccd-passwd) and autofs
    739 foreach my $script ("bccd-unite-sw", "perfctr",) {
     740foreach my $script ("bccd-unite-sw", "perfctr","bccd-bootflags","bccd-automated") {
    740741    $Bccd->run_test(
    741742        "system",
  • bccd-ng/branches/sam-test_fw/packages/etc/skel/.bash_profile

    r3071 r3072  
    1010#    . ~/.bashrc
    1111#fi
     12
     13if [ -f /bccd_boot_flags ]; then
     14    source /bccd_boot_flags
     15fi
    1216
    1317# set PATH so it includes user's private bin if it exists
     
    5357fi
    5458
    55 if [ -f /testmode -a ! -z "$DISPLAY" ]; then
     59if [ -f /testmode -a -z "$DISPLAY" ]; then
    5660        startx
    5761fi
    5862
    59 if [ `tty` == "/dev/pts/0" -a $HOSTNAME == "node000@bccd.net" ]; then
    60 if [ -f /controlgenerate ]; then
     63if [ `tty` == "/dev/pts/0" -a $HOSTNAME == "node000.bccd.net" ]; then
     64if [ $BUILD_CONTROL == '1' ]; then
    6165echo "initiating automatic control generation
    6266some tests may take a little while"
     
    6569echo "Please email developers@bccd.net
    6670and state that you have run the iso.
    67 Control generation complete.
    68 You may shut down your system."
     71Control generation complete."
    6972else
    7073echo "initiating test suite"
     
    7275echo "test suite completed"
    7376fi
     77echo "Ctrl-C to cancel automatic shutdown"
     78sudo shutdown -h 1
    7479fi
    7580
  • bccd-ng/branches/sam-test_fw/trees/usr/local/lib/site_perl/5.10.0/Bccd.pm

    r3071 r3072  
    21902190
    21912191sub config_nic_dialog {
     2192        print "Starting config_nic_dialog";
    21922193    my($self,$d,$nic_conf) = @_;
    21932194    my($temp,$bccd_nic,$gotpxe,$dhcp_source,$sub);
     
    22202221        }
    22212222        } else {
    2222                         my %request = ( "EXPECTED_NODES" => "8,4");
    2223                         get_boot_flags_from_NIC(%request);
    2224                         system ("source /bccd_boot_flags") or croak "$!";
    2225                         $bccd_nic = $ENV{'BCCD_NIC'};
    2226                         print "BCCD NIC:$bccd_nic\n";
     2223                        open (TEST,'</bccd_boot_flags') or croak "$!";
     2224                my      @command = grep (/BCCD_NIC/, <TEST>);
     2225                print "|" . $command[0] . "|\n";
     2226                        if ($command[0] =~ m/export BCCD_NIC=(.*)$/){
     2227                                $bccd_nic = $1;
     2228                        }
     2229                        #system ("/bccd_boot_flags") or croak "could not run /bccd_boot_flags: $!";
     2230                        #$bccd_nic = $ENV{'BCCD_NIC'};
     2231                        print "test\ntest\ntest\ntest\nBCCD NIC:|$bccd_nic|\n";
    22272232                        sleep 1;
    22282233                }
     
    23072312        }
    23082313    }
     2314       
     2315        print "ending config_nic_dialog:";
     2316        foreach my $key ( keys %{$nic_conf}){
     2317        print "$key->" . $nic_conf->{$key} ;
     2318        }
    23092319   
    23102320    return $nic_conf;
     
    24572467        }
    24582468       
    2459         my $boot_flags = "export BCCD_NIC=$bccd_nic\n";
     2469        my $boot_flags = "#!/bin/sh\nexport BCCD_NIC=$bccd_nic\n";     
    24602470
    24612471        foreach my $key(keys %request){
     
    24782488                        print BOOTFLAGS $boot_flags;
    24792489                close(BOOTFLAGS);
     2490                chmod 0755, '/bccd_boot_flags';
    24802491        }
    24812492}
Note: See TracChangeset for help on using the changeset viewer.