"Fossies" - the Fresh Open Source Software Archive

Member "CSSC-1.4.1/tests/admin/r-option.sh" (22 May 2011, 1571 Bytes) of package /linux/privat/CSSC-1.4.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #! /bin/sh
    2 
    3 # r-option:  Testing for the -r option of admin.
    4 
    5 # Import common functions & definitions.
    6 . ../common/test-common
    7 
    8 # Import function which tells us if we're testing CSSC, or something else.
    9 . ../common/real-thing
   10 
   11 g=new.txt
   12 s=s.$g
   13 
   14 
   15 # Create an empty SCCS file to work on.
   16 remove $g $s
   17 echo "%M%" > $g
   18 docommand R1 "${admin} -i$g $s" 0 "" ""
   19 
   20 # Make sure it really is ID 1.1.
   21 docommand R2 "${prs} -d:I: $s" 0 "1.1\n" ""
   22 
   23 
   24 # Create an empty SCCS file to work on, with initial SID 2.1.
   25 remove $g $s
   26 echo "%M%" > $g
   27 docommand R3 "${vg_admin} -i$g -r2 $s" 0 "" ""
   28 
   29 # Make sure it really is ID 2.1.
   30 docommand R4 "${prs} -d:I: $s" 0 "2.1\n" ""
   31 
   32 
   33 ##
   34 ## Some implementations of SCCS don't allow (e.g.) -r1.2,
   35 ## so if we're not running agains CSSC, we skip the 
   36 ## tests that deal with that kind of thing.
   37 ##
   38 
   39 if $TESTING_CSSC
   40 then
   41     # Create an empty SCCS file to work on.
   42     remove $g $s
   43     echo "%M%" > $g
   44     docommand t1 "${vg_admin} -i$g -r1.2 $s" 0 "" IGNORE
   45     
   46     # Make sure it really is ID 1.2.
   47     docommand t2 "${prs} -d:I: $s" 0 "1.2\n" ""
   48     
   49     
   50     # Now try a 4-component SID.
   51     remove $g $s
   52     echo "%M%" > $g
   53     docommand t3 "${vg_admin} -i$g -r1.2.2.1 $s" 0 "" IGNORE
   54     
   55     # Make sure it really is ID 1.2.
   56     docommand t4 "${prs} -d:I: $s" 0 "1.2.2.1\n" ""
   57 
   58     
   59     # The -r option must be accompanied by the -i option.
   60     # Using the -n option just isn't enough.
   61     remove $g $s
   62     echo "%M%" > $g
   63     docommand t5 "${admin} -n -r2 $s" 1 "" IGNORE
   64     
   65 else
   66     echo Tests t1-t5 have been skipped
   67 fi
   68 
   69 
   70 remove $s $g
   71 success