Fossil SCM
Adjust test case for TH1 permissions tests. WrUnver (y) is not enabled by default and must be intentionally set.
Commit
582d335737f2438327108d60c013644111263933b7cdd07d03e9189e0a1f23ee
Parent
9b32c180eba0f46…
1 file changed
+8
-2
+8
-2
| --- test/th1.test | ||
| +++ test/th1.test | ||
| @@ -563,14 +563,18 @@ | ||
| 563 | 563 | puts "Skipping th1-anycap-*-1 perm tests: uncommitted changes in Fossil checkout." |
| 564 | 564 | } else { |
| 565 | 565 | set skip_anycap 0 |
| 566 | 566 | } |
| 567 | 567 | |
| 568 | -foreach perm [list a b c d e f g h i j k l m n o p q r s t u v w x y z] { | |
| 568 | +foreach perm [list \ | |
| 569 | + a b c d e f g h i j k l m n o p q r s t u v w x y z \ | |
| 570 | + A D \ | |
| 571 | + 2 3 4 5 6 7 ] { | |
| 569 | 572 | if {$perm eq "u"} continue; # NOTE: Skip "reader" meta-permission. |
| 570 | 573 | if {$perm eq "v"} continue; # NOTE: Skip "developer" meta-permission. |
| 571 | 574 | |
| 575 | + set ::env(TH1_TEST_USER_CAPS) sxy | |
| 572 | 576 | fossil test-th-eval "anycap $perm" |
| 573 | 577 | test th1-anycap-no-$perm-1 {$RESULT eq {0}} |
| 574 | 578 | |
| 575 | 579 | fossil test-th-eval "hascap $perm" |
| 576 | 580 | test th1-hascap-no-$perm-1 {$RESULT eq {0}} |
| @@ -579,26 +583,28 @@ | ||
| 579 | 583 | test th1-anoncap-no-$perm-1 {$RESULT eq {0}} |
| 580 | 584 | |
| 581 | 585 | if {$skip_anycap} { continue } |
| 582 | 586 | |
| 583 | 587 | run_in_checkout { |
| 588 | + set ::env(TH1_TEST_USER_CAPS) sxy | |
| 584 | 589 | fossil test-th-eval --set-user-caps "anycap $perm" |
| 585 | 590 | test th1-anycap-yes-$perm-1 {$RESULT eq {1}} |
| 586 | 591 | |
| 587 | 592 | set ::env(TH1_TEST_USER_CAPS) 1; # NOTE: Bad permission. |
| 588 | 593 | fossil test-th-eval --set-user-caps "anycap $perm" |
| 589 | 594 | test th1-anycap-no-$perm-1 {$RESULT eq {0}} |
| 590 | - unset ::env(TH1_TEST_USER_CAPS) | |
| 591 | 595 | |
| 596 | + set ::env(TH1_TEST_USER_CAPS) sxy | |
| 592 | 597 | fossil test-th-eval --set-user-caps "hascap $perm" |
| 593 | 598 | test th1-hascap-yes-$perm-1 {$RESULT eq {1}} |
| 594 | 599 | |
| 595 | 600 | set ::env(TH1_TEST_USER_CAPS) 1; # NOTE: Bad permission. |
| 596 | 601 | fossil test-th-eval --set-user-caps "hascap $perm" |
| 597 | 602 | test th1-hascap-no-$perm-1 {$RESULT eq {0}} |
| 598 | 603 | unset ::env(TH1_TEST_USER_CAPS) |
| 599 | 604 | |
| 605 | + set ::env(TH1_TEST_ANON_CAPS) sxy | |
| 600 | 606 | fossil test-th-eval --set-anon-caps "anoncap $perm" |
| 601 | 607 | test th1-anoncap-yes-$perm-1 {$RESULT eq {1}} |
| 602 | 608 | |
| 603 | 609 | set ::env(TH1_TEST_ANON_CAPS) 1; # NOTE: Bad permission. |
| 604 | 610 | fossil test-th-eval --set-anon-caps "anoncap $perm" |
| 605 | 611 |
| --- test/th1.test | |
| +++ test/th1.test | |
| @@ -563,14 +563,18 @@ | |
| 563 | puts "Skipping th1-anycap-*-1 perm tests: uncommitted changes in Fossil checkout." |
| 564 | } else { |
| 565 | set skip_anycap 0 |
| 566 | } |
| 567 | |
| 568 | foreach perm [list a b c d e f g h i j k l m n o p q r s t u v w x y z] { |
| 569 | if {$perm eq "u"} continue; # NOTE: Skip "reader" meta-permission. |
| 570 | if {$perm eq "v"} continue; # NOTE: Skip "developer" meta-permission. |
| 571 | |
| 572 | fossil test-th-eval "anycap $perm" |
| 573 | test th1-anycap-no-$perm-1 {$RESULT eq {0}} |
| 574 | |
| 575 | fossil test-th-eval "hascap $perm" |
| 576 | test th1-hascap-no-$perm-1 {$RESULT eq {0}} |
| @@ -579,26 +583,28 @@ | |
| 579 | test th1-anoncap-no-$perm-1 {$RESULT eq {0}} |
| 580 | |
| 581 | if {$skip_anycap} { continue } |
| 582 | |
| 583 | run_in_checkout { |
| 584 | fossil test-th-eval --set-user-caps "anycap $perm" |
| 585 | test th1-anycap-yes-$perm-1 {$RESULT eq {1}} |
| 586 | |
| 587 | set ::env(TH1_TEST_USER_CAPS) 1; # NOTE: Bad permission. |
| 588 | fossil test-th-eval --set-user-caps "anycap $perm" |
| 589 | test th1-anycap-no-$perm-1 {$RESULT eq {0}} |
| 590 | unset ::env(TH1_TEST_USER_CAPS) |
| 591 | |
| 592 | fossil test-th-eval --set-user-caps "hascap $perm" |
| 593 | test th1-hascap-yes-$perm-1 {$RESULT eq {1}} |
| 594 | |
| 595 | set ::env(TH1_TEST_USER_CAPS) 1; # NOTE: Bad permission. |
| 596 | fossil test-th-eval --set-user-caps "hascap $perm" |
| 597 | test th1-hascap-no-$perm-1 {$RESULT eq {0}} |
| 598 | unset ::env(TH1_TEST_USER_CAPS) |
| 599 | |
| 600 | fossil test-th-eval --set-anon-caps "anoncap $perm" |
| 601 | test th1-anoncap-yes-$perm-1 {$RESULT eq {1}} |
| 602 | |
| 603 | set ::env(TH1_TEST_ANON_CAPS) 1; # NOTE: Bad permission. |
| 604 | fossil test-th-eval --set-anon-caps "anoncap $perm" |
| 605 |
| --- test/th1.test | |
| +++ test/th1.test | |
| @@ -563,14 +563,18 @@ | |
| 563 | puts "Skipping th1-anycap-*-1 perm tests: uncommitted changes in Fossil checkout." |
| 564 | } else { |
| 565 | set skip_anycap 0 |
| 566 | } |
| 567 | |
| 568 | foreach perm [list \ |
| 569 | a b c d e f g h i j k l m n o p q r s t u v w x y z \ |
| 570 | A D \ |
| 571 | 2 3 4 5 6 7 ] { |
| 572 | if {$perm eq "u"} continue; # NOTE: Skip "reader" meta-permission. |
| 573 | if {$perm eq "v"} continue; # NOTE: Skip "developer" meta-permission. |
| 574 | |
| 575 | set ::env(TH1_TEST_USER_CAPS) sxy |
| 576 | fossil test-th-eval "anycap $perm" |
| 577 | test th1-anycap-no-$perm-1 {$RESULT eq {0}} |
| 578 | |
| 579 | fossil test-th-eval "hascap $perm" |
| 580 | test th1-hascap-no-$perm-1 {$RESULT eq {0}} |
| @@ -579,26 +583,28 @@ | |
| 583 | test th1-anoncap-no-$perm-1 {$RESULT eq {0}} |
| 584 | |
| 585 | if {$skip_anycap} { continue } |
| 586 | |
| 587 | run_in_checkout { |
| 588 | set ::env(TH1_TEST_USER_CAPS) sxy |
| 589 | fossil test-th-eval --set-user-caps "anycap $perm" |
| 590 | test th1-anycap-yes-$perm-1 {$RESULT eq {1}} |
| 591 | |
| 592 | set ::env(TH1_TEST_USER_CAPS) 1; # NOTE: Bad permission. |
| 593 | fossil test-th-eval --set-user-caps "anycap $perm" |
| 594 | test th1-anycap-no-$perm-1 {$RESULT eq {0}} |
| 595 | |
| 596 | set ::env(TH1_TEST_USER_CAPS) sxy |
| 597 | fossil test-th-eval --set-user-caps "hascap $perm" |
| 598 | test th1-hascap-yes-$perm-1 {$RESULT eq {1}} |
| 599 | |
| 600 | set ::env(TH1_TEST_USER_CAPS) 1; # NOTE: Bad permission. |
| 601 | fossil test-th-eval --set-user-caps "hascap $perm" |
| 602 | test th1-hascap-no-$perm-1 {$RESULT eq {0}} |
| 603 | unset ::env(TH1_TEST_USER_CAPS) |
| 604 | |
| 605 | set ::env(TH1_TEST_ANON_CAPS) sxy |
| 606 | fossil test-th-eval --set-anon-caps "anoncap $perm" |
| 607 | test th1-anoncap-yes-$perm-1 {$RESULT eq {1}} |
| 608 | |
| 609 | set ::env(TH1_TEST_ANON_CAPS) 1; # NOTE: Bad permission. |
| 610 | fossil test-th-eval --set-anon-caps "anoncap $perm" |
| 611 |