Changeset: d288b1a9f6e6 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d288b1a9f6e6
Removed Files:
        monetdb5/mal/Tests/tst005.mal
Modified Files:
        monetdb5/mal/Tests/All
        monetdb5/mal/Tests/tst830.mal
        monetdb5/mal/Tests/tst830.stable.out
Branch: default
Log Message:

Add test 830
Avoid the part that makes a permanent change to the password of
monetdb.


diffs (167 lines):

diff --git a/monetdb5/mal/Tests/All b/monetdb5/mal/Tests/All
--- a/monetdb5/mal/Tests/All
+++ b/monetdb5/mal/Tests/All
@@ -172,7 +172,7 @@ tst802
 tst804
 tst810
 tst819
-#tst830
+tst830
 tst840
 tst850
 tst866
diff --git a/monetdb5/mal/Tests/tst005.mal b/monetdb5/mal/Tests/tst005.mal
deleted file mode 100644
--- a/monetdb5/mal/Tests/tst005.mal
+++ /dev/null
@@ -1,16 +0,0 @@
-# test proper exists
-       i:= 1;
-       j:= 2;
-barrier v:=i;
-       io.print("entered");
-       io.print(v);
-       redo v:= v -1;
-exit   v;
-       io.print("doubles");
-barrier (v,w):=(i,j);
-       io.print("entered");
-       io.print(v);
-       v:= v-1;
-       redo (v,w):= (v,w);
-exit   (v,w);
-       io.print("finished");
diff --git a/monetdb5/mal/Tests/tst830.mal b/monetdb5/mal/Tests/tst830.mal
--- a/monetdb5/mal/Tests/tst830.mal
+++ b/monetdb5/mal/Tests/tst830.mal
@@ -5,7 +5,7 @@ function foo();
        pw := clients.backendsum("Pmonetdb");
        id := clients.addUser("monetdb", pw);
 catch MALException:str;
-       io.printf("%s\n",MALException);
+       io.printf("0: %s\n",MALException);
 exit MALException;
 
        # should print 1@0 or something
@@ -32,33 +32,34 @@ exit MALException;
        # now try to set the password for ourself, should fail
        clients.setPassword("monetdb", pw);
 catch InvalidCredentialsException:str;
-       io.printf("%s\n", InvalidCredentialsException);
+       io.printf("1: %s\n", InvalidCredentialsException);
 exit InvalidCredentialsException;
-
-       # change our own password
-       mypw := clients.backendsum("monetdb");
-       clients.changePassword(mypw, pw);
-       # try it again, should fail...
-       clients.changePassword(mypw, pw);
-catch InvalidCredentialsException:str;
-       io.printf("%s\n",InvalidCredentialsException);
-       InvalidCredentialsException:= nil:str;
-exit InvalidCredentialsException;
+oldpw := clients.getPassword("monetdb");
+#
+#      # change our own password, 
+#      mypw := clients.backendsum("monetdb");
+#      clients.changePassword(mypw, pw);
+#      # try it again, should fail...
+#      clients.changePassword(mypw, pw);
+#catch InvalidCredentialsException:str;
+#      io.printf("2: %s\n",InvalidCredentialsException);
+#      InvalidCredentialsException:= nil:str;
+#exit InvalidCredentialsException;
 
        # all should fail
        clients.checkPermission("monetdb","Pmonetdb");
 catch InvalidCredentialsException:str;
-       io.printf("%s\n",InvalidCredentialsException);
+       io.printf("3: %s\n",InvalidCredentialsException);
        InvalidCredentialsException:= nil:str;
 exit InvalidCredentialsException;
        clients.checkPermission("monetdb","x");
 catch InvalidCredentialsException:str;
-       io.printf("%s\n",InvalidCredentialsException);
+       io.printf("4: %s\n",InvalidCredentialsException);
        InvalidCredentialsException:= nil:str;
 exit InvalidCredentialsException;
        clients.checkPermission("x","Pmonetdb");
 catch InvalidCredentialsException:str;
-       io.printf("%s\n",InvalidCredentialsException);
+       io.printf("5: %s\n",InvalidCredentialsException);
        InvalidCredentialsException:= nil:str;
 exit InvalidCredentialsException;
 end;
diff --git a/monetdb5/mal/Tests/tst830.stable.out 
b/monetdb5/mal/Tests/tst830.stable.out
--- a/monetdb5/mal/Tests/tst830.stable.out
+++ b/monetdb5/mal/Tests/tst830.stable.out
@@ -23,7 +23,7 @@ function user.foo():void;
     pw := clients.backendsum("Pmonetdb");
     id := clients.addUser("monetdb",pw);
 catch MALException:str;
-    io.printf("%s\n",MALException);
+    io.printf("0: %s\n",MALException);
 exit MALException:str;
 # should print 1@0 or something 
     id := clients.addUser("test",pw);
@@ -44,31 +44,22 @@ exit MALException:str;
 # now try to set the password for ourself, should fail 
     clients.setPassword("monetdb",pw);
 catch InvalidCredentialsException:str;
-    io.printf("%s\n",InvalidCredentialsException);
-exit InvalidCredentialsException:str;
-# change our own password 
-    mypw := clients.backendsum("monetdb");
-    clients.changePassword(mypw,pw);
-# try it again, should fail... 
-    clients.changePassword(mypw,pw);
-catch InvalidCredentialsException:str;
-    io.printf("%s\n",InvalidCredentialsException);
-    InvalidCredentialsException:str := nil:str;
+    io.printf("1: %s\n",InvalidCredentialsException);
 exit InvalidCredentialsException:str;
 # all should fail 
     clients.checkPermission("monetdb","Pmonetdb");
 catch InvalidCredentialsException:str;
-    io.printf("%s\n",InvalidCredentialsException);
+    io.printf("3: %s\n",InvalidCredentialsException);
     InvalidCredentialsException:str := nil:str;
 exit InvalidCredentialsException:str;
     clients.checkPermission("monetdb","x");
 catch InvalidCredentialsException:str;
-    io.printf("%s\n",InvalidCredentialsException);
+    io.printf("4: %s\n",InvalidCredentialsException);
     InvalidCredentialsException:str := nil:str;
 exit InvalidCredentialsException:str;
     clients.checkPermission("x","Pmonetdb");
 catch InvalidCredentialsException:str;
-    io.printf("%s\n",InvalidCredentialsException);
+    io.printf("5: %s\n",InvalidCredentialsException);
     InvalidCredentialsException:str := nil:str;
 exit InvalidCredentialsException:str;
 end user.foo;
@@ -77,7 +68,7 @@ function user.main():void;
 # this should fail, the monetdb user is already there 
     user.foo();
 end user.main;
-MALException:addUser:user 'monetdb' already exists
+0: MALException:addUser:user 'monetdb' already exists
 [ 1@0 ]
 [ 2@0 ]
 #--------------------------#
@@ -93,11 +84,10 @@ MALException:addUser:user 'monetdb' alre
 #--------------------------#
 [ 0@0, 0@0,    "monetdb"  ]
 [ 1@0, 1@0,    "test"  ]
-InvalidCredentialsException:setPassword:The administrator cannot set its own 
password, use changePassword instead
-InvalidCredentialsException:changePassword:Access denied
-InvalidCredentialsException:checkCredentials:invalid credentials for user 
'monetdb'
-InvalidCredentialsException:checkCredentials:invalid credentials for user 
'monetdb'
-InvalidCredentialsException:checkCredentials:invalid credentials for user 'x'
+1: InvalidCredentialsException:setPassword:The administrator cannot set its 
own password, use changePassword instead
+3: InvalidCredentialsException:checkCredentials:invalid credentials for user 
'monetdb'
+4: InvalidCredentialsException:checkCredentials:invalid credentials for user 
'monetdb'
+5: InvalidCredentialsException:checkCredentials:invalid credentials for user 
'x'
 
 # 08:49:53 >  
 # 08:49:53 >  Done.
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to