Fossil SCM

Adjust test case for TH1 permissions tests. WrUnver (y) is not enabled by default and must be intentionally set.

andybradford 2019-09-07 15:03 trunk
Commit 582d335737f2438327108d60c013644111263933b7cdd07d03e9189e0a1f23ee
1 file changed +8 -2
+8 -2
--- test/th1.test
+++ test/th1.test
@@ -563,14 +563,18 @@
563563
puts "Skipping th1-anycap-*-1 perm tests: uncommitted changes in Fossil checkout."
564564
} else {
565565
set skip_anycap 0
566566
}
567567
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 ] {
569572
if {$perm eq "u"} continue; # NOTE: Skip "reader" meta-permission.
570573
if {$perm eq "v"} continue; # NOTE: Skip "developer" meta-permission.
571574
575
+ set ::env(TH1_TEST_USER_CAPS) sxy
572576
fossil test-th-eval "anycap $perm"
573577
test th1-anycap-no-$perm-1 {$RESULT eq {0}}
574578
575579
fossil test-th-eval "hascap $perm"
576580
test th1-hascap-no-$perm-1 {$RESULT eq {0}}
@@ -579,26 +583,28 @@
579583
test th1-anoncap-no-$perm-1 {$RESULT eq {0}}
580584
581585
if {$skip_anycap} { continue }
582586
583587
run_in_checkout {
588
+ set ::env(TH1_TEST_USER_CAPS) sxy
584589
fossil test-th-eval --set-user-caps "anycap $perm"
585590
test th1-anycap-yes-$perm-1 {$RESULT eq {1}}
586591
587592
set ::env(TH1_TEST_USER_CAPS) 1; # NOTE: Bad permission.
588593
fossil test-th-eval --set-user-caps "anycap $perm"
589594
test th1-anycap-no-$perm-1 {$RESULT eq {0}}
590
- unset ::env(TH1_TEST_USER_CAPS)
591595
596
+ set ::env(TH1_TEST_USER_CAPS) sxy
592597
fossil test-th-eval --set-user-caps "hascap $perm"
593598
test th1-hascap-yes-$perm-1 {$RESULT eq {1}}
594599
595600
set ::env(TH1_TEST_USER_CAPS) 1; # NOTE: Bad permission.
596601
fossil test-th-eval --set-user-caps "hascap $perm"
597602
test th1-hascap-no-$perm-1 {$RESULT eq {0}}
598603
unset ::env(TH1_TEST_USER_CAPS)
599604
605
+ set ::env(TH1_TEST_ANON_CAPS) sxy
600606
fossil test-th-eval --set-anon-caps "anoncap $perm"
601607
test th1-anoncap-yes-$perm-1 {$RESULT eq {1}}
602608
603609
set ::env(TH1_TEST_ANON_CAPS) 1; # NOTE: Bad permission.
604610
fossil test-th-eval --set-anon-caps "anoncap $perm"
605611
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button