Commit f8096e28 authored by Kirk Webb's avatar Kirk Webb

Added regression test script.

parent de09dfd7
......@@ -7,7 +7,7 @@
defvar ntpserver ;; ntp1
# grab root password
readvar rootpass ;; Type password for root user
readvar rootpass ;; Type password for root user ;; secure
log Disabling User Access Controls
addreg HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System ;; EnableLUA ;; Dword ;; 0
......
......@@ -23,7 +23,7 @@ defvar gitdir ;; emulab-devel
defvar cyg_pkgs ;; boost-devel,bison,byacc,cygrunsrv,flex,gawk,gcc4,g++4,inetutils,make,openssh,openssl-devel,perl,psmisc,python,shutdown,swig,sysvinit,tcsh,util-linux,w32api,bc,cvs,ed,emacs,file,gdb,git,nano,nc,patch,rcs,rpm,rsync,rxvt,subversion,vim,wget,unzip,zip
# Get cygwin user password
readvar sshpass ;; Please supply a password for the Cygwin SSH user
readvar sshpass ;; Please supply a password for the Cygwin SSH user ;; secure
log Downloading Cygwin setup executable.
mkdir %cygsrc%
......
......@@ -129,7 +129,7 @@ Function readvar_func($cmdarr) {
if ($secure) {
$myval = decode_secstring(Read-Host -assecurestring $myprompt)
$verf = decode_secstring(Read-Host -assecurestring "$myprompt (verify)")
if ($myvar -ne $verf) {
if ($myval -ne $verf) {
log("ERROR: strings do not match.")
return $FAIL
}
......
### Variable tests
defvar foo ;; This is foo
defvar bar ;; Bar this is
readvar baz ;; Give me something for baz
log Here is some foo: %foo%
log Here is some bar: %bar%
log Baz is last: %baz%
log cram them together: \%foo%\%bar%\%baz%\ - and repeat! %baz% | %foo%
### File manipulation tests.
defvar mtestfile ;; C:\Windows\Temp\_setuptest_.txt
runcmd cmd.exe ;; /c type NUL > %mtestfile% ;; 0
appendfile %mtestfile% ;; Here is some content
appendfile %mtestfile% ;; Another line
appendfile %mtestfile% ;; appending text is fun!
appendfile %mtestfile% ;; one two one two three
edfile %mtestfile% ;; append\w+ ;; editing
edfile %mtestfile% ;; (one) ;; $1$1
runcmd cmd.exe ;; /c type %mtestfile% ;; 0
runcmd cmd.exe ;; /c del %mtestfile% ;; 0
### User tests
defvar user1 ;; barfoo
defvar user2 ;; quux
readvar pass1 ;; Enter a password ;; secure
readvar pass2 ;; Enter another password ;; secure
log adding user %user1%
adduser %user1% ;; %pass1% ;; admin
adduser %user2% ;; %pass2%
adduser %user1% ;; %pass1%
runcmd net.exe ;; users
runcmd net.exe ;; localgroup Administrators
removeuser %user1%
removeuser %user2%
removeuser %user1%
runcmd net.exe ;; users
runcmd net.exe ;; localgroup Administrators
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment