Fossil SCM

Revert test/trunk-fixes.tcl and all its invocations.

danshearer 2026-11-27 18:13 UTC test-suite-new
Commit a75ba583b7779e4c33cca69b8250ee63ee9c02d9b71ba9aa9da112acd26b4a9e
+17 -27
--- test/cgi.test
+++ test/cgi.test
@@ -6,11 +6,10 @@
66
#
77
# Plain HTTP, the same request arriving over ssh, and SCGI.
88
#
99
1010
test_setup
11
-source [file join $::testfiledir trunk-fixes.tcl]
1211
1312
write_file a.txt "an unversioned file\n"
1413
fossil uv add a.txt
1514
set cgiRepo [file join [pwd] .rep.fossil]
1615
@@ -489,31 +488,29 @@
489488
}
490489
# A range that runs past the end of the file stops at the end.
491490
set cgiReply [cgi_range bytes=15-2147483646]
492491
test_eq cgi-range-past-end [reply_body $cgiReply] fghij
493492
test_eq cgi-range-past-end-header [reply_header $cgiReply Content-Range] \
494
- "bytes 15-19/20" $::trunkMark
495
-test_eq cgi-range-past-end-length [reply_header $cgiReply Content-Length] 5 \
496
- $::trunkMark
493
+ "bytes 15-19/20"
494
+test_eq cgi-range-past-end-length [reply_header $cgiReply Content-Length] 5
497495
# A range that starts at or after the end gets 416 and no content.
498496
foreach {cgiName cgiRange} {at-end bytes=20-20 after-end bytes=25-30} {
499497
set cgiReply [cgi_range $cgiRange]
500498
test cgi-range-unsatisfiable-$cgiName {
501499
[reply_status $cgiReply] eq "HTTP/1.0 416 Range Not Satisfiable"
502500
&& [reply_header $cgiReply Content-Range] eq "bytes */20"
503
- && [reply_header $cgiReply Content-Length] eq "0"} $::trunkMark
501
+ && [reply_header $cgiReply Content-Length] eq "0"}
504502
}
505503
# A number too large for an int is not taken as a smaller one.
506504
set cgiReply [cgi_range bytes=0-4294967299]
507
-test_eq cgi-range-too-large [reply_status $cgiReply] "HTTP/1.0 200 OK" \
508
- $::trunkMark
505
+test_eq cgi-range-too-large [reply_status $cgiReply] "HTTP/1.0 200 OK"
509506
# A reply other than 206 is sent whole, whatever range was asked for.
510507
set cgiReply [cgi_send [request_get /uv/nosuch.css [list "Range: bytes=3-9"]] \
511508
--ipaddr 127.0.0.1]
512509
test cgi-range-not-found {
513510
[string match "HTTP/1.0 404 *" [reply_status $cgiReply]]
514
- && [string match "<!DOCTYPE*" [reply_body $cgiReply]]} $::trunkMark
511
+ && [string match "<!DOCTYPE*" [reply_body $cgiReply]]}
515512
516513
###############################################################################
517514
# More shapes of form data in several parts.
518515
519516
proc cgi_form {body} {
@@ -581,11 +578,11 @@
581578
"[cgi_part after ok]--XB--\r\n"] ""]
582579
write_file request.txt [cgi_post $cgiType $cgiBody]
583580
file delete reply.txt
584581
fossil_raw -seconds 15 http $cgiRepo --in request.txt --out reply.txt \
585582
--ipaddr 127.0.0.1 --localauth
586
-test cgi-multipart-lone-quote {$CODE == 0} $::trunkMark
583
+test cgi-multipart-lone-quote {$CODE == 0}
587584
588585
# Only the first 49 words of a header line are read.
589586
set cgiWords ""
590587
for {set cgiI 0} {$cgiI < 30} {incr cgiI} \
591588
{ append cgiWords " w$cgiI \"q$cgiI\";" }
@@ -602,11 +599,11 @@
602599
set cgiReply [cgi_form \
603600
[join [list \
604601
"--XB\r\nContent-Disposition: form-data; name= \"\r\n\r\n" \
605602
"v\r\n[cgi_part after ok]--XB--\r\n"] ""]]
606603
test {cgi-multipart-quote-alone} {[reply_status $cgiReply] eq "HTTP/1.0 200 OK"
607
- && [cgi_param $cgiReply after] eq "ok"} $::trunkMark
604
+ && [cgi_param $cgiReply after] eq "ok"}
608605
609606
# Content that begins with a zero byte has no parts.
610607
set cgiReply [cgi_form "\000--XB\r\n[cgi_part a v]--XB--\r\n"]
611608
test cgi-multipart-zero-first {[reply_status $cgiReply] eq "HTTP/1.0 200 OK"
612609
&& [cgi_param $cgiReply a] eq "-"}
@@ -737,12 +734,11 @@
737734
# The user-edit page needs "login", "info", "pw" and "apply" to make a
738735
# change. A request with "login" alone changes nothing.
739736
set cgiBody "id=0&login=cgighost&csrf=$cgiToken"
740737
cgi_admin [cgi_post_from http://x/setup_uedit /setup_uedit $cgiBody]
741738
test cgi-all-needs-every-field \
742
- {[fossil sql "SELECT count(*) FROM user WHERE login='cgighost'"] == 0} \
743
- $::trunkMark
739
+ {[fossil sql "SELECT count(*) FROM user WHERE login='cgighost'"] == 0}
744740
745741
###############################################################################
746742
# Request methods and the same reader over ssh.
747743
748744
set ::env(SSH_CONNECTION) "127.0.0.1 5000 127.0.0.1 22"
@@ -973,12 +969,11 @@
973969
--ipaddr 127.0.0.1 --localauth --baseurl $base
974970
return [read_file reply.txt]
975971
}
976972
set cgiReply [cgi_cookie_delete http://x]
977973
test cgi-cookie-delete {[string match \
978
- "*Set-Cookie: fossil_display_settings=null;*max-age=-1;*" $cgiReply]} \
979
- [sanitizer_trunk_mark]
974
+ "*Set-Cookie: fossil_display_settings=null;*max-age=-1;*" $cgiReply]}
980975
set cgiReply [cgi_cookie_delete https://x/d]
981976
test cgi-cookie-delete-secure {[string match "*max-age=-1;*secure;*" $cgiReply]
982977
|| [string match "*max-age=-1;* secure*" $cgiReply]}
983978
984979
###############################################################################
@@ -1044,11 +1039,11 @@
10441039
test cgi-range-ignored-no-dash {[reply_status $cgiReply] eq "HTTP/1.0 200 OK"
10451040
&& [reply_header $cgiReply Content-Range] eq "-"}
10461041
set cgiReply [cgi_send [request_get /raw/$cgiArt?m=application/x-fossil \
10471042
[list "Range: bytes=1-3"]] --ipaddr 127.0.0.1 --localauth]
10481043
test cgi-range-sync-type {[reply_status $cgiReply] eq "HTTP/1.0 200 OK"
1049
- && [reply_header $cgiReply Content-Range] eq "-"} $::trunkMark
1044
+ && [reply_header $cgiReply Content-Range] eq "-"}
10501045
set cgiReply [cgi_send [request_get /raw/$cgiFile?m=text/plain \
10511046
[list "Range: bytes=4-8"]] --ipaddr 9.9.9.9]
10521047
test_eq cgi-range-artifact [reply_body $cgiReply] quick
10531048
test_eq cgi-range-artifact-cache [reply_header $cgiReply Cache-Control] \
10541049
"max-age=315360000, immutable"
@@ -1112,11 +1107,11 @@
11121107
append cgiLogText [read_file $cgiLog]
11131108
file delete $cgiLog
11141109
}
11151110
test cgi-httptrace-post-content {[string match "*body=sent" $cgiLogText]}
11161111
test cgi-httptrace-post-header \
1117
- {[string match "POST /test-env HTTP/1.1*" $cgiLogText]} $::trunkMark
1112
+ {[string match "POST /test-env HTTP/1.1*" $cgiLogText]}
11181113
write_file request.txt [request_get /test-env?traced=2]
11191114
if {$::tcl_platform(platform) eq "unix"} {
11201115
set cgiHere [pwd]
11211116
file mkdir readonly
11221117
file attributes readonly -permissions 0555
@@ -1385,11 +1380,11 @@
13851380
if {[normalize_result] eq "1"} {
13861381
foreach {cgiName cgiBody} {not-json {not json} array {[1]} one-byte x} {
13871382
set cgiReply [cgi_admin [cgi_post application/json $cgiBody /json/version]]
13881383
test cgi-json-post-$cgiName-exit {$CODE == 0}
13891384
test cgi-json-post-$cgiName-reply \
1390
- {[string match "*FOSSIL-1101*" $cgiReply]} $::trunkMark
1385
+ {[string match "*FOSSIL-1101*" $cgiReply]}
13911386
}
13921387
set cgiReply [cgi_admin [cgi_post text/x-other {[1]} /json/version]]
13931388
test cgi-json-post-other-type {[reply_status $cgiReply] eq "HTTP/1.0 200 OK"
13941389
&& [string match "*jsonApiVersion*" $cgiReply]}
13951390
set cgiReply [cgi_send [cgi_scgi {
@@ -1415,18 +1410,13 @@
14151410
set cgiReply [cgi_send \
14161411
[join [list \
14171412
"$cgiFirst\n\nfossil\nGET /test-env?second=2 HTTP/1.1\r\n" \
14181413
"Host: x\r\nContent-Length: 0\r\nContent-Type: text/plain\r\n" \
14191414
"X-Fossil-Transport: ssh\r\n\r\n"] ""] --localauth]
1420
-if {$::sanitizerBuild} {
1421
- test_skip_part "cgi-ssh-flip: a sanitizer reports a read of the\
1422
- Content-Length of a later request from memory that is reused"
1423
-} else {
1424
- test cgi-ssh-flip {[string match "test1\n*" $cgiReply]
1425
- && [string match "*HTTP_USER_AGENT = First*first = 1*second = 2*" \
1426
- $cgiReply]}
1427
-}
1415
+test cgi-ssh-flip {[string match "test1\n*" $cgiReply]
1416
+ && [string match "*HTTP_USER_AGENT = First*first = 1*second = 2*" \
1417
+ $cgiReply]}
14281418
foreach {cgiName cgiMore cgiError} [list \
14291419
cut-short "\n" "incorrect transport_flip" \
14301420
not-blank "\nxyz\n" "transport_flip failed" \
14311421
other-command "\n\nother\n" "transport_open failed" \
14321422
no-request "\n\nfossil\n" "missing HTTP header" \
@@ -1668,11 +1658,11 @@
16681658
# The same command run from the command line, where there is no request
16691659
# to answer, is an error.
16701660
foreach {cgiName cgiUrl} {path /stat url http://other.example/x} {
16711661
fossil_raw test-th-eval "redirect $cgiUrl"
16721662
test cgi-th1-redirect-no-request-$cgiName {$CODE == 0 && [string match \
1673
- "*redirect is only allowed in a web request*" $RESULT]} $::trunkMark
1663
+ "*redirect is only allowed in a web request*" $RESULT]}
16741664
}
16751665
# With --http the command line makes a reply, and a redirect to a full
16761666
# URL is sent as "302".
16771667
fossil_raw test-th-eval --http "redirect http://other.example/x"
16781668
test cgi-th1-redirect-http-option {$CODE == 0
@@ -1953,11 +1943,11 @@
19531943
cgiPrinted cgiReply
19541944
test cgi-server-unix-$cgiName {
19551945
$cgiPrinted eq "Listening for HTTP requests on unix socket sock2"
19561946
&& [reply_status $cgiReply] eq "HTTP/1.0 200 OK"
19571947
&& [format %o [expr {[file attributes sock2 -permissions] & 0o777}]]
1958
- eq $cgiMode} $::trunkMark
1948
+ eq $cgiMode}
19591949
}
19601950
fossil_raw -seconds 30 server --socket-mode rw --socket-name sock3 $cgiRepo
19611951
test cgi-server-unix-mode-not-a-number {$CODE == 1 && [string match \
19621952
"*cannot change permissions on sock3 to \"rw\"*" $RESULT]}
19631953
} else {
19641954
--- test/cgi.test
+++ test/cgi.test
@@ -6,11 +6,10 @@
6 #
7 # Plain HTTP, the same request arriving over ssh, and SCGI.
8 #
9
10 test_setup
11 source [file join $::testfiledir trunk-fixes.tcl]
12
13 write_file a.txt "an unversioned file\n"
14 fossil uv add a.txt
15 set cgiRepo [file join [pwd] .rep.fossil]
16
@@ -489,31 +488,29 @@
489 }
490 # A range that runs past the end of the file stops at the end.
491 set cgiReply [cgi_range bytes=15-2147483646]
492 test_eq cgi-range-past-end [reply_body $cgiReply] fghij
493 test_eq cgi-range-past-end-header [reply_header $cgiReply Content-Range] \
494 "bytes 15-19/20" $::trunkMark
495 test_eq cgi-range-past-end-length [reply_header $cgiReply Content-Length] 5 \
496 $::trunkMark
497 # A range that starts at or after the end gets 416 and no content.
498 foreach {cgiName cgiRange} {at-end bytes=20-20 after-end bytes=25-30} {
499 set cgiReply [cgi_range $cgiRange]
500 test cgi-range-unsatisfiable-$cgiName {
501 [reply_status $cgiReply] eq "HTTP/1.0 416 Range Not Satisfiable"
502 && [reply_header $cgiReply Content-Range] eq "bytes */20"
503 && [reply_header $cgiReply Content-Length] eq "0"} $::trunkMark
504 }
505 # A number too large for an int is not taken as a smaller one.
506 set cgiReply [cgi_range bytes=0-4294967299]
507 test_eq cgi-range-too-large [reply_status $cgiReply] "HTTP/1.0 200 OK" \
508 $::trunkMark
509 # A reply other than 206 is sent whole, whatever range was asked for.
510 set cgiReply [cgi_send [request_get /uv/nosuch.css [list "Range: bytes=3-9"]] \
511 --ipaddr 127.0.0.1]
512 test cgi-range-not-found {
513 [string match "HTTP/1.0 404 *" [reply_status $cgiReply]]
514 && [string match "<!DOCTYPE*" [reply_body $cgiReply]]} $::trunkMark
515
516 ###############################################################################
517 # More shapes of form data in several parts.
518
519 proc cgi_form {body} {
@@ -581,11 +578,11 @@
581 "[cgi_part after ok]--XB--\r\n"] ""]
582 write_file request.txt [cgi_post $cgiType $cgiBody]
583 file delete reply.txt
584 fossil_raw -seconds 15 http $cgiRepo --in request.txt --out reply.txt \
585 --ipaddr 127.0.0.1 --localauth
586 test cgi-multipart-lone-quote {$CODE == 0} $::trunkMark
587
588 # Only the first 49 words of a header line are read.
589 set cgiWords ""
590 for {set cgiI 0} {$cgiI < 30} {incr cgiI} \
591 { append cgiWords " w$cgiI \"q$cgiI\";" }
@@ -602,11 +599,11 @@
602 set cgiReply [cgi_form \
603 [join [list \
604 "--XB\r\nContent-Disposition: form-data; name= \"\r\n\r\n" \
605 "v\r\n[cgi_part after ok]--XB--\r\n"] ""]]
606 test {cgi-multipart-quote-alone} {[reply_status $cgiReply] eq "HTTP/1.0 200 OK"
607 && [cgi_param $cgiReply after] eq "ok"} $::trunkMark
608
609 # Content that begins with a zero byte has no parts.
610 set cgiReply [cgi_form "\000--XB\r\n[cgi_part a v]--XB--\r\n"]
611 test cgi-multipart-zero-first {[reply_status $cgiReply] eq "HTTP/1.0 200 OK"
612 && [cgi_param $cgiReply a] eq "-"}
@@ -737,12 +734,11 @@
737 # The user-edit page needs "login", "info", "pw" and "apply" to make a
738 # change. A request with "login" alone changes nothing.
739 set cgiBody "id=0&login=cgighost&csrf=$cgiToken"
740 cgi_admin [cgi_post_from http://x/setup_uedit /setup_uedit $cgiBody]
741 test cgi-all-needs-every-field \
742 {[fossil sql "SELECT count(*) FROM user WHERE login='cgighost'"] == 0} \
743 $::trunkMark
744
745 ###############################################################################
746 # Request methods and the same reader over ssh.
747
748 set ::env(SSH_CONNECTION) "127.0.0.1 5000 127.0.0.1 22"
@@ -973,12 +969,11 @@
973 --ipaddr 127.0.0.1 --localauth --baseurl $base
974 return [read_file reply.txt]
975 }
976 set cgiReply [cgi_cookie_delete http://x]
977 test cgi-cookie-delete {[string match \
978 "*Set-Cookie: fossil_display_settings=null;*max-age=-1;*" $cgiReply]} \
979 [sanitizer_trunk_mark]
980 set cgiReply [cgi_cookie_delete https://x/d]
981 test cgi-cookie-delete-secure {[string match "*max-age=-1;*secure;*" $cgiReply]
982 || [string match "*max-age=-1;* secure*" $cgiReply]}
983
984 ###############################################################################
@@ -1044,11 +1039,11 @@
1044 test cgi-range-ignored-no-dash {[reply_status $cgiReply] eq "HTTP/1.0 200 OK"
1045 && [reply_header $cgiReply Content-Range] eq "-"}
1046 set cgiReply [cgi_send [request_get /raw/$cgiArt?m=application/x-fossil \
1047 [list "Range: bytes=1-3"]] --ipaddr 127.0.0.1 --localauth]
1048 test cgi-range-sync-type {[reply_status $cgiReply] eq "HTTP/1.0 200 OK"
1049 && [reply_header $cgiReply Content-Range] eq "-"} $::trunkMark
1050 set cgiReply [cgi_send [request_get /raw/$cgiFile?m=text/plain \
1051 [list "Range: bytes=4-8"]] --ipaddr 9.9.9.9]
1052 test_eq cgi-range-artifact [reply_body $cgiReply] quick
1053 test_eq cgi-range-artifact-cache [reply_header $cgiReply Cache-Control] \
1054 "max-age=315360000, immutable"
@@ -1112,11 +1107,11 @@
1112 append cgiLogText [read_file $cgiLog]
1113 file delete $cgiLog
1114 }
1115 test cgi-httptrace-post-content {[string match "*body=sent" $cgiLogText]}
1116 test cgi-httptrace-post-header \
1117 {[string match "POST /test-env HTTP/1.1*" $cgiLogText]} $::trunkMark
1118 write_file request.txt [request_get /test-env?traced=2]
1119 if {$::tcl_platform(platform) eq "unix"} {
1120 set cgiHere [pwd]
1121 file mkdir readonly
1122 file attributes readonly -permissions 0555
@@ -1385,11 +1380,11 @@
1385 if {[normalize_result] eq "1"} {
1386 foreach {cgiName cgiBody} {not-json {not json} array {[1]} one-byte x} {
1387 set cgiReply [cgi_admin [cgi_post application/json $cgiBody /json/version]]
1388 test cgi-json-post-$cgiName-exit {$CODE == 0}
1389 test cgi-json-post-$cgiName-reply \
1390 {[string match "*FOSSIL-1101*" $cgiReply]} $::trunkMark
1391 }
1392 set cgiReply [cgi_admin [cgi_post text/x-other {[1]} /json/version]]
1393 test cgi-json-post-other-type {[reply_status $cgiReply] eq "HTTP/1.0 200 OK"
1394 && [string match "*jsonApiVersion*" $cgiReply]}
1395 set cgiReply [cgi_send [cgi_scgi {
@@ -1415,18 +1410,13 @@
1415 set cgiReply [cgi_send \
1416 [join [list \
1417 "$cgiFirst\n\nfossil\nGET /test-env?second=2 HTTP/1.1\r\n" \
1418 "Host: x\r\nContent-Length: 0\r\nContent-Type: text/plain\r\n" \
1419 "X-Fossil-Transport: ssh\r\n\r\n"] ""] --localauth]
1420 if {$::sanitizerBuild} {
1421 test_skip_part "cgi-ssh-flip: a sanitizer reports a read of the\
1422 Content-Length of a later request from memory that is reused"
1423 } else {
1424 test cgi-ssh-flip {[string match "test1\n*" $cgiReply]
1425 && [string match "*HTTP_USER_AGENT = First*first = 1*second = 2*" \
1426 $cgiReply]}
1427 }
1428 foreach {cgiName cgiMore cgiError} [list \
1429 cut-short "\n" "incorrect transport_flip" \
1430 not-blank "\nxyz\n" "transport_flip failed" \
1431 other-command "\n\nother\n" "transport_open failed" \
1432 no-request "\n\nfossil\n" "missing HTTP header" \
@@ -1668,11 +1658,11 @@
1668 # The same command run from the command line, where there is no request
1669 # to answer, is an error.
1670 foreach {cgiName cgiUrl} {path /stat url http://other.example/x} {
1671 fossil_raw test-th-eval "redirect $cgiUrl"
1672 test cgi-th1-redirect-no-request-$cgiName {$CODE == 0 && [string match \
1673 "*redirect is only allowed in a web request*" $RESULT]} $::trunkMark
1674 }
1675 # With --http the command line makes a reply, and a redirect to a full
1676 # URL is sent as "302".
1677 fossil_raw test-th-eval --http "redirect http://other.example/x"
1678 test cgi-th1-redirect-http-option {$CODE == 0
@@ -1953,11 +1943,11 @@
1953 cgiPrinted cgiReply
1954 test cgi-server-unix-$cgiName {
1955 $cgiPrinted eq "Listening for HTTP requests on unix socket sock2"
1956 && [reply_status $cgiReply] eq "HTTP/1.0 200 OK"
1957 && [format %o [expr {[file attributes sock2 -permissions] & 0o777}]]
1958 eq $cgiMode} $::trunkMark
1959 }
1960 fossil_raw -seconds 30 server --socket-mode rw --socket-name sock3 $cgiRepo
1961 test cgi-server-unix-mode-not-a-number {$CODE == 1 && [string match \
1962 "*cannot change permissions on sock3 to \"rw\"*" $RESULT]}
1963 } else {
1964
--- test/cgi.test
+++ test/cgi.test
@@ -6,11 +6,10 @@
6 #
7 # Plain HTTP, the same request arriving over ssh, and SCGI.
8 #
9
10 test_setup
 
11
12 write_file a.txt "an unversioned file\n"
13 fossil uv add a.txt
14 set cgiRepo [file join [pwd] .rep.fossil]
15
@@ -489,31 +488,29 @@
488 }
489 # A range that runs past the end of the file stops at the end.
490 set cgiReply [cgi_range bytes=15-2147483646]
491 test_eq cgi-range-past-end [reply_body $cgiReply] fghij
492 test_eq cgi-range-past-end-header [reply_header $cgiReply Content-Range] \
493 "bytes 15-19/20"
494 test_eq cgi-range-past-end-length [reply_header $cgiReply Content-Length] 5
 
495 # A range that starts at or after the end gets 416 and no content.
496 foreach {cgiName cgiRange} {at-end bytes=20-20 after-end bytes=25-30} {
497 set cgiReply [cgi_range $cgiRange]
498 test cgi-range-unsatisfiable-$cgiName {
499 [reply_status $cgiReply] eq "HTTP/1.0 416 Range Not Satisfiable"
500 && [reply_header $cgiReply Content-Range] eq "bytes */20"
501 && [reply_header $cgiReply Content-Length] eq "0"}
502 }
503 # A number too large for an int is not taken as a smaller one.
504 set cgiReply [cgi_range bytes=0-4294967299]
505 test_eq cgi-range-too-large [reply_status $cgiReply] "HTTP/1.0 200 OK"
 
506 # A reply other than 206 is sent whole, whatever range was asked for.
507 set cgiReply [cgi_send [request_get /uv/nosuch.css [list "Range: bytes=3-9"]] \
508 --ipaddr 127.0.0.1]
509 test cgi-range-not-found {
510 [string match "HTTP/1.0 404 *" [reply_status $cgiReply]]
511 && [string match "<!DOCTYPE*" [reply_body $cgiReply]]}
512
513 ###############################################################################
514 # More shapes of form data in several parts.
515
516 proc cgi_form {body} {
@@ -581,11 +578,11 @@
578 "[cgi_part after ok]--XB--\r\n"] ""]
579 write_file request.txt [cgi_post $cgiType $cgiBody]
580 file delete reply.txt
581 fossil_raw -seconds 15 http $cgiRepo --in request.txt --out reply.txt \
582 --ipaddr 127.0.0.1 --localauth
583 test cgi-multipart-lone-quote {$CODE == 0}
584
585 # Only the first 49 words of a header line are read.
586 set cgiWords ""
587 for {set cgiI 0} {$cgiI < 30} {incr cgiI} \
588 { append cgiWords " w$cgiI \"q$cgiI\";" }
@@ -602,11 +599,11 @@
599 set cgiReply [cgi_form \
600 [join [list \
601 "--XB\r\nContent-Disposition: form-data; name= \"\r\n\r\n" \
602 "v\r\n[cgi_part after ok]--XB--\r\n"] ""]]
603 test {cgi-multipart-quote-alone} {[reply_status $cgiReply] eq "HTTP/1.0 200 OK"
604 && [cgi_param $cgiReply after] eq "ok"}
605
606 # Content that begins with a zero byte has no parts.
607 set cgiReply [cgi_form "\000--XB\r\n[cgi_part a v]--XB--\r\n"]
608 test cgi-multipart-zero-first {[reply_status $cgiReply] eq "HTTP/1.0 200 OK"
609 && [cgi_param $cgiReply a] eq "-"}
@@ -737,12 +734,11 @@
734 # The user-edit page needs "login", "info", "pw" and "apply" to make a
735 # change. A request with "login" alone changes nothing.
736 set cgiBody "id=0&login=cgighost&csrf=$cgiToken"
737 cgi_admin [cgi_post_from http://x/setup_uedit /setup_uedit $cgiBody]
738 test cgi-all-needs-every-field \
739 {[fossil sql "SELECT count(*) FROM user WHERE login='cgighost'"] == 0}
 
740
741 ###############################################################################
742 # Request methods and the same reader over ssh.
743
744 set ::env(SSH_CONNECTION) "127.0.0.1 5000 127.0.0.1 22"
@@ -973,12 +969,11 @@
969 --ipaddr 127.0.0.1 --localauth --baseurl $base
970 return [read_file reply.txt]
971 }
972 set cgiReply [cgi_cookie_delete http://x]
973 test cgi-cookie-delete {[string match \
974 "*Set-Cookie: fossil_display_settings=null;*max-age=-1;*" $cgiReply]}
 
975 set cgiReply [cgi_cookie_delete https://x/d]
976 test cgi-cookie-delete-secure {[string match "*max-age=-1;*secure;*" $cgiReply]
977 || [string match "*max-age=-1;* secure*" $cgiReply]}
978
979 ###############################################################################
@@ -1044,11 +1039,11 @@
1039 test cgi-range-ignored-no-dash {[reply_status $cgiReply] eq "HTTP/1.0 200 OK"
1040 && [reply_header $cgiReply Content-Range] eq "-"}
1041 set cgiReply [cgi_send [request_get /raw/$cgiArt?m=application/x-fossil \
1042 [list "Range: bytes=1-3"]] --ipaddr 127.0.0.1 --localauth]
1043 test cgi-range-sync-type {[reply_status $cgiReply] eq "HTTP/1.0 200 OK"
1044 && [reply_header $cgiReply Content-Range] eq "-"}
1045 set cgiReply [cgi_send [request_get /raw/$cgiFile?m=text/plain \
1046 [list "Range: bytes=4-8"]] --ipaddr 9.9.9.9]
1047 test_eq cgi-range-artifact [reply_body $cgiReply] quick
1048 test_eq cgi-range-artifact-cache [reply_header $cgiReply Cache-Control] \
1049 "max-age=315360000, immutable"
@@ -1112,11 +1107,11 @@
1107 append cgiLogText [read_file $cgiLog]
1108 file delete $cgiLog
1109 }
1110 test cgi-httptrace-post-content {[string match "*body=sent" $cgiLogText]}
1111 test cgi-httptrace-post-header \
1112 {[string match "POST /test-env HTTP/1.1*" $cgiLogText]}
1113 write_file request.txt [request_get /test-env?traced=2]
1114 if {$::tcl_platform(platform) eq "unix"} {
1115 set cgiHere [pwd]
1116 file mkdir readonly
1117 file attributes readonly -permissions 0555
@@ -1385,11 +1380,11 @@
1380 if {[normalize_result] eq "1"} {
1381 foreach {cgiName cgiBody} {not-json {not json} array {[1]} one-byte x} {
1382 set cgiReply [cgi_admin [cgi_post application/json $cgiBody /json/version]]
1383 test cgi-json-post-$cgiName-exit {$CODE == 0}
1384 test cgi-json-post-$cgiName-reply \
1385 {[string match "*FOSSIL-1101*" $cgiReply]}
1386 }
1387 set cgiReply [cgi_admin [cgi_post text/x-other {[1]} /json/version]]
1388 test cgi-json-post-other-type {[reply_status $cgiReply] eq "HTTP/1.0 200 OK"
1389 && [string match "*jsonApiVersion*" $cgiReply]}
1390 set cgiReply [cgi_send [cgi_scgi {
@@ -1415,18 +1410,13 @@
1410 set cgiReply [cgi_send \
1411 [join [list \
1412 "$cgiFirst\n\nfossil\nGET /test-env?second=2 HTTP/1.1\r\n" \
1413 "Host: x\r\nContent-Length: 0\r\nContent-Type: text/plain\r\n" \
1414 "X-Fossil-Transport: ssh\r\n\r\n"] ""] --localauth]
1415 test cgi-ssh-flip {[string match "test1\n*" $cgiReply]
1416 && [string match "*HTTP_USER_AGENT = First*first = 1*second = 2*" \
1417 $cgiReply]}
 
 
 
 
 
1418 foreach {cgiName cgiMore cgiError} [list \
1419 cut-short "\n" "incorrect transport_flip" \
1420 not-blank "\nxyz\n" "transport_flip failed" \
1421 other-command "\n\nother\n" "transport_open failed" \
1422 no-request "\n\nfossil\n" "missing HTTP header" \
@@ -1668,11 +1658,11 @@
1658 # The same command run from the command line, where there is no request
1659 # to answer, is an error.
1660 foreach {cgiName cgiUrl} {path /stat url http://other.example/x} {
1661 fossil_raw test-th-eval "redirect $cgiUrl"
1662 test cgi-th1-redirect-no-request-$cgiName {$CODE == 0 && [string match \
1663 "*redirect is only allowed in a web request*" $RESULT]}
1664 }
1665 # With --http the command line makes a reply, and a redirect to a full
1666 # URL is sent as "302".
1667 fossil_raw test-th-eval --http "redirect http://other.example/x"
1668 test cgi-th1-redirect-http-option {$CODE == 0
@@ -1953,11 +1943,11 @@
1943 cgiPrinted cgiReply
1944 test cgi-server-unix-$cgiName {
1945 $cgiPrinted eq "Listening for HTTP requests on unix socket sock2"
1946 && [reply_status $cgiReply] eq "HTTP/1.0 200 OK"
1947 && [format %o [expr {[file attributes sock2 -permissions] & 0o777}]]
1948 eq $cgiMode}
1949 }
1950 fossil_raw -seconds 30 server --socket-mode rw --socket-name sock3 $cgiRepo
1951 test cgi-server-unix-mode-not-a-number {$CODE == 1 && [string match \
1952 "*cannot change permissions on sock3 to \"rw\"*" $RESULT]}
1953 } else {
1954
--- test/config.test
+++ test/config.test
@@ -11,11 +11,10 @@
1111
# The first sections run at every level, and the rest need
1212
# -assurance ci or stress.
1313
require_no_open_checkout
1414
1515
test_setup ""
16
-source [file join $::testfiledir trunk-fixes.tcl]
1716
set configDir [pwd]
1817
set ::env(FOSSIL_USER) tester
1918
2019
###############################################################################
2120
# Helpers.
@@ -505,18 +504,17 @@
505504
configNew r-$configArea.fossil
506505
configFill r-$configArea.fossil
507506
configRun configuration reset $configArea -R r-$configArea.fossil
508507
test_eq config-reset-$configArea-removes \
509508
[configState r-$configArea.fossil $configArea 0 1] \
510
- [configDefaults $configArea] $::trunkMark
509
+ [configDefaults $configArea]
511510
}
512511
configNew r-all.fossil
513512
configFill r-all.fossil
514513
configRun configuration reset all -R r-all.fossil
515514
test config-reset-all-removes-aliases {[configSql r-all.fossil "SELECT count(*)
516
- FROM config WHERE name GLOB 'walias:/*' OR name GLOB 'interwiki:*'"] == 0} \
517
- $::trunkMark
515
+ FROM config WHERE name GLOB 'walias:/*' OR name GLOB 'interwiki:*'"] == 0}
518516
test_eq config-reset-all-settings [configSql r-all.fossil "SELECT group_concat(
519517
name) FROM (SELECT name FROM config WHERE NOT name GLOB 'walias:/*' AND
520518
NOT name GLOB 'interwiki:*' ORDER BY name)"] \
521519
"aux-schema,content-schema,hash-policy,project-code,rebuilt,server-code"
522520
@@ -564,12 +562,11 @@
564562
###############################################################################
565563
# Export of changes since a time: only what changed since then is written.
566564
567565
configRun configuration export project since.cfg --since 2099-01-01 \
568566
-R a.fossil
569
-test config-export-since-future {$CODE == 0 && [configKinds since.cfg] eq ""} \
570
- $::trunkMark
567
+test config-export-since-future {$CODE == 0 && [configKinds since.cfg] eq ""}
571568
configRun configuration export project since2.cfg --since 2000-01-01 \
572569
-R a.fossil
573570
test config-export-since-past {$CODE == 0 &&
574571
[configKinds since2.cfg] eq "/config"}
575572
@@ -1336,14 +1333,14 @@
13361333
fossil_raw -input "y\n" test-var-list --unset -R w.fossil
13371334
test config-var-unset-no-pattern {[configSql w.fossil "SELECT count(*) FROM
13381335
config"] == $configCount}
13391336
fossil_raw -input "Y\n" test-var-list "a-s*" --unset -R w.fossil
13401337
test config-var-unset-capital {[configSql w.fossil "SELECT count(*) FROM config
1341
- WHERE name='a-short'"] == 0} $::trunkMark
1338
+ WHERE name='a-short'"] == 0}
13421339
fossil_raw -input "y\n" test-var-list "a-s*" --unset -R w.fossil
13431340
test config-var-unset-yes {$CODE == 0 && [configSql w.fossil "SELECT count(*)
1344
- FROM config WHERE name='a-short'"] == 0} $::trunkMark
1341
+ FROM config WHERE name='a-short'"] == 0}
13451342
13461343
###############################################################################
13471344
# The rest of the file needs a TCP connection over the loopback interface.
13481345
13491346
if {![loopback_available]} {
@@ -1465,11 +1462,11 @@
14651462
$configPart 1
14661463
}
14671464
} else {
14681465
test config-push-$configLabel-$configArea-refused {
14691466
[string first "not authorized to push configuration" $RESULT] >= 0}
1470
- test config-push-refused-status {$CODE == 1} $::trunkMark
1467
+ test config-push-refused-status {$CODE == 1}
14711468
test_eq config-push-$configLabel-$configArea-unchanged \
14721469
[configDump cs.fossil] $configPre
14731470
}
14741471
}
14751472
test_stop_server $configStop [lindex $configServerProc 0] \
14761473
--- test/config.test
+++ test/config.test
@@ -11,11 +11,10 @@
11 # The first sections run at every level, and the rest need
12 # -assurance ci or stress.
13 require_no_open_checkout
14
15 test_setup ""
16 source [file join $::testfiledir trunk-fixes.tcl]
17 set configDir [pwd]
18 set ::env(FOSSIL_USER) tester
19
20 ###############################################################################
21 # Helpers.
@@ -505,18 +504,17 @@
505 configNew r-$configArea.fossil
506 configFill r-$configArea.fossil
507 configRun configuration reset $configArea -R r-$configArea.fossil
508 test_eq config-reset-$configArea-removes \
509 [configState r-$configArea.fossil $configArea 0 1] \
510 [configDefaults $configArea] $::trunkMark
511 }
512 configNew r-all.fossil
513 configFill r-all.fossil
514 configRun configuration reset all -R r-all.fossil
515 test config-reset-all-removes-aliases {[configSql r-all.fossil "SELECT count(*)
516 FROM config WHERE name GLOB 'walias:/*' OR name GLOB 'interwiki:*'"] == 0} \
517 $::trunkMark
518 test_eq config-reset-all-settings [configSql r-all.fossil "SELECT group_concat(
519 name) FROM (SELECT name FROM config WHERE NOT name GLOB 'walias:/*' AND
520 NOT name GLOB 'interwiki:*' ORDER BY name)"] \
521 "aux-schema,content-schema,hash-policy,project-code,rebuilt,server-code"
522
@@ -564,12 +562,11 @@
564 ###############################################################################
565 # Export of changes since a time: only what changed since then is written.
566
567 configRun configuration export project since.cfg --since 2099-01-01 \
568 -R a.fossil
569 test config-export-since-future {$CODE == 0 && [configKinds since.cfg] eq ""} \
570 $::trunkMark
571 configRun configuration export project since2.cfg --since 2000-01-01 \
572 -R a.fossil
573 test config-export-since-past {$CODE == 0 &&
574 [configKinds since2.cfg] eq "/config"}
575
@@ -1336,14 +1333,14 @@
1336 fossil_raw -input "y\n" test-var-list --unset -R w.fossil
1337 test config-var-unset-no-pattern {[configSql w.fossil "SELECT count(*) FROM
1338 config"] == $configCount}
1339 fossil_raw -input "Y\n" test-var-list "a-s*" --unset -R w.fossil
1340 test config-var-unset-capital {[configSql w.fossil "SELECT count(*) FROM config
1341 WHERE name='a-short'"] == 0} $::trunkMark
1342 fossil_raw -input "y\n" test-var-list "a-s*" --unset -R w.fossil
1343 test config-var-unset-yes {$CODE == 0 && [configSql w.fossil "SELECT count(*)
1344 FROM config WHERE name='a-short'"] == 0} $::trunkMark
1345
1346 ###############################################################################
1347 # The rest of the file needs a TCP connection over the loopback interface.
1348
1349 if {![loopback_available]} {
@@ -1465,11 +1462,11 @@
1465 $configPart 1
1466 }
1467 } else {
1468 test config-push-$configLabel-$configArea-refused {
1469 [string first "not authorized to push configuration" $RESULT] >= 0}
1470 test config-push-refused-status {$CODE == 1} $::trunkMark
1471 test_eq config-push-$configLabel-$configArea-unchanged \
1472 [configDump cs.fossil] $configPre
1473 }
1474 }
1475 test_stop_server $configStop [lindex $configServerProc 0] \
1476
--- test/config.test
+++ test/config.test
@@ -11,11 +11,10 @@
11 # The first sections run at every level, and the rest need
12 # -assurance ci or stress.
13 require_no_open_checkout
14
15 test_setup ""
 
16 set configDir [pwd]
17 set ::env(FOSSIL_USER) tester
18
19 ###############################################################################
20 # Helpers.
@@ -505,18 +504,17 @@
504 configNew r-$configArea.fossil
505 configFill r-$configArea.fossil
506 configRun configuration reset $configArea -R r-$configArea.fossil
507 test_eq config-reset-$configArea-removes \
508 [configState r-$configArea.fossil $configArea 0 1] \
509 [configDefaults $configArea]
510 }
511 configNew r-all.fossil
512 configFill r-all.fossil
513 configRun configuration reset all -R r-all.fossil
514 test config-reset-all-removes-aliases {[configSql r-all.fossil "SELECT count(*)
515 FROM config WHERE name GLOB 'walias:/*' OR name GLOB 'interwiki:*'"] == 0}
 
516 test_eq config-reset-all-settings [configSql r-all.fossil "SELECT group_concat(
517 name) FROM (SELECT name FROM config WHERE NOT name GLOB 'walias:/*' AND
518 NOT name GLOB 'interwiki:*' ORDER BY name)"] \
519 "aux-schema,content-schema,hash-policy,project-code,rebuilt,server-code"
520
@@ -564,12 +562,11 @@
562 ###############################################################################
563 # Export of changes since a time: only what changed since then is written.
564
565 configRun configuration export project since.cfg --since 2099-01-01 \
566 -R a.fossil
567 test config-export-since-future {$CODE == 0 && [configKinds since.cfg] eq ""}
 
568 configRun configuration export project since2.cfg --since 2000-01-01 \
569 -R a.fossil
570 test config-export-since-past {$CODE == 0 &&
571 [configKinds since2.cfg] eq "/config"}
572
@@ -1336,14 +1333,14 @@
1333 fossil_raw -input "y\n" test-var-list --unset -R w.fossil
1334 test config-var-unset-no-pattern {[configSql w.fossil "SELECT count(*) FROM
1335 config"] == $configCount}
1336 fossil_raw -input "Y\n" test-var-list "a-s*" --unset -R w.fossil
1337 test config-var-unset-capital {[configSql w.fossil "SELECT count(*) FROM config
1338 WHERE name='a-short'"] == 0}
1339 fossil_raw -input "y\n" test-var-list "a-s*" --unset -R w.fossil
1340 test config-var-unset-yes {$CODE == 0 && [configSql w.fossil "SELECT count(*)
1341 FROM config WHERE name='a-short'"] == 0}
1342
1343 ###############################################################################
1344 # The rest of the file needs a TCP connection over the loopback interface.
1345
1346 if {![loopback_available]} {
@@ -1465,11 +1462,11 @@
1462 $configPart 1
1463 }
1464 } else {
1465 test config-push-$configLabel-$configArea-refused {
1466 [string first "not authorized to push configuration" $RESULT] >= 0}
1467 test config-push-refused-status {$CODE == 1}
1468 test_eq config-push-$configLabel-$configArea-unchanged \
1469 [configDump cs.fossil] $configPre
1470 }
1471 }
1472 test_stop_server $configStop [lindex $configServerProc 0] \
1473
--- test/content.test
+++ test/content.test
@@ -9,11 +9,10 @@
99
#
1010
1111
require_no_open_checkout
1212
1313
test_setup
14
-source [file join $::testfiledir trunk-fixes.tcl]
1514
1615
# The record number of the artifact with the given hash.
1716
#
1817
proc content_rid {hash} {
1918
return [fossil_sql "SELECT rid FROM blob WHERE uuid='$hash'"]
@@ -677,17 +676,12 @@
677676
SELECT content('rid:200103')=(SELECT t FROM c WHERE kind=1);
678677
SELECT length(content('rid:200015'));
679678
SELECT count(*) FROM n WHERE k IN (0,7,14,16,23,31,39,95,102,103)
680679
AND content('rid:'||(200000+k))=(SELECT t FROM c WHERE c.kind=n.kind);
681680
}
682
- if {$::sanitizerBuild} {
683
- test_skip_part "content-cache-size and -reads: a sanitizer reports\
684
- a null pointer given to memcpy by the delta SQL functions"
685
- } else {
686
- test content-cache-size {$CODE == 0}
687
- test_eq content-cache-size-reads [string trim $RESULT] "1\n0\n10"
688
- }
681
+ test content-cache-size {$CODE == 0}
682
+ test_eq content-cache-size-reads [string trim $RESULT] "1\n0\n10"
689683
}
690684
691685
###############################################################################
692686
693687
test_cleanup
694688
--- test/content.test
+++ test/content.test
@@ -9,11 +9,10 @@
9 #
10
11 require_no_open_checkout
12
13 test_setup
14 source [file join $::testfiledir trunk-fixes.tcl]
15
16 # The record number of the artifact with the given hash.
17 #
18 proc content_rid {hash} {
19 return [fossil_sql "SELECT rid FROM blob WHERE uuid='$hash'"]
@@ -677,17 +676,12 @@
677 SELECT content('rid:200103')=(SELECT t FROM c WHERE kind=1);
678 SELECT length(content('rid:200015'));
679 SELECT count(*) FROM n WHERE k IN (0,7,14,16,23,31,39,95,102,103)
680 AND content('rid:'||(200000+k))=(SELECT t FROM c WHERE c.kind=n.kind);
681 }
682 if {$::sanitizerBuild} {
683 test_skip_part "content-cache-size and -reads: a sanitizer reports\
684 a null pointer given to memcpy by the delta SQL functions"
685 } else {
686 test content-cache-size {$CODE == 0}
687 test_eq content-cache-size-reads [string trim $RESULT] "1\n0\n10"
688 }
689 }
690
691 ###############################################################################
692
693 test_cleanup
694
--- test/content.test
+++ test/content.test
@@ -9,11 +9,10 @@
9 #
10
11 require_no_open_checkout
12
13 test_setup
 
14
15 # The record number of the artifact with the given hash.
16 #
17 proc content_rid {hash} {
18 return [fossil_sql "SELECT rid FROM blob WHERE uuid='$hash'"]
@@ -677,17 +676,12 @@
676 SELECT content('rid:200103')=(SELECT t FROM c WHERE kind=1);
677 SELECT length(content('rid:200015'));
678 SELECT count(*) FROM n WHERE k IN (0,7,14,16,23,31,39,95,102,103)
679 AND content('rid:'||(200000+k))=(SELECT t FROM c WHERE c.kind=n.kind);
680 }
681 test content-cache-size {$CODE == 0}
682 test_eq content-cache-size-reads [string trim $RESULT] "1\n0\n10"
 
 
 
 
 
683 }
684
685 ###############################################################################
686
687 test_cleanup
688
--- test/crosslink.test
+++ test/crosslink.test
@@ -13,11 +13,10 @@
1313
# The first sections run at every level, and the rest need
1414
# -assurance stress.
1515
require_no_open_checkout
1616
1717
test_setup
18
-source [file join $::testfiledir trunk-fixes.tcl]
1918
2019
set crosslinkSeq 0
2120
2221
# Write a file that holds the cards $body and the Z card for them, and
2322
# return its name.
@@ -632,13 +631,11 @@
632631
] {
633632
set crosslinkG [crosslink_put "D 2026-01-08T10:0[incr crosslinkI]:00.000
634633
T +parent $crosslinkM3 $crosslinkValue
635634
U alice
636635
"]
637
- test crosslink-reparent-$crosslinkName {$CODE == 0 && $crosslinkG ne ""} \
638
- [sanitizer_trunk_mark $crosslinkName \
639
- {two-sha3-short one-sha3-short one-sha1-short}]
636
+ test crosslink-reparent-$crosslinkName {$CODE == 0 && $crosslinkG ne ""}
640637
test_eq crosslink-reparent-$crosslinkName-ignored [fossil_sql "SELECT
641638
uuid FROM plink, blob WHERE pid=rid AND isprim AND cid=(SELECT rid
642639
FROM blob WHERE uuid='$crosslinkM3')"] $crosslinkM2
643640
}
644641
fossil rebuild
@@ -686,12 +683,11 @@
686683
set crosslinkHash [string trim [fossil_sql "SELECT uuid FROM blob,
687684
attachment WHERE rid=attachid ORDER BY rid LIMIT 1"] ']
688685
}
689686
fossil test-artifact-to-json $crosslinkHash
690687
test crosslink-json-$crosslinkKind {$CODE == 0}
691
- crosslink_match crosslink-json-$crosslinkKind-text $RESULT $crosslinkWant \
692
- [sanitizer_trunk_mark $crosslinkKind tag]
688
+ crosslink_match crosslink-json-$crosslinkKind-text $RESULT $crosslinkWant
693689
}
694690
# Every artifact that the repository shows in its timeline has a JSON
695691
# form.
696692
fossil sql "SELECT uuid FROM blob WHERE rid IN (SELECT objid FROM event)"
697693
set crosslinkAll [string map {' {}} $RESULT]
@@ -1314,18 +1310,17 @@
13141310
{*reports the input is ok*manifest_parse() worked}
13151311
13161312
fossil test-parse-manifest $crosslinkEmptyP
13171313
crosslink_match crosslink-mcdc-agree-empty-p-parses $RESULT \
13181314
{*manifest_parse() worked*}
1319
-test crosslink-mcdc-agree-empty-p {![string match *disagree* $RESULT]} \
1320
- $::trunkMark
1315
+test crosslink-mcdc-agree-empty-p {![string match *disagree* $RESULT]}
13211316
13221317
fossil test-parse-manifest wf-signed-no-newline.txt
13231318
crosslink_match crosslink-mcdc-agree-signed-no-newline-refused $RESULT \
13241319
{*ERROR: not terminated*}
13251320
test crosslink-mcdc-agree-signed-no-newline \
1326
- {![string match *disagree* $RESULT]} $::trunkMark
1321
+ {![string match *disagree* $RESULT]}
13271322
13281323
# The same for content held by a repository.
13291324
fossil init wf.fossil
13301325
fossil test-content-put -R wf.fossil wf-signed.txt $crosslinkEmptyP \
13311326
wf-signed-no-newline.txt
@@ -1332,11 +1327,11 @@
13321327
test crosslink-mcdc-agree-stored {$CODE == 0}
13331328
fossil test-parse-all-blobs --wellformed -R wf.fossil
13341329
test crosslink-mcdc-agree-stored-checked \
13351330
{$CODE == 0 && [regexp {(\d+) tests with} $RESULT all n] && $n >= 3}
13361331
crosslink_match crosslink-mcdc-agree-stored-no-errors $RESULT \
1337
- {*tests with 0 errors*} $::trunkMark
1332
+ {*tests with 0 errors*}
13381333
13391334
###############################################################################
13401335
# More values of the "parent" tag. A value that ends in a space names the
13411336
# parent before the space. A value long enough to be a hash that is not
13421337
# one is ignored. A "parent" tag on a wiki page makes no links.
13431338
--- test/crosslink.test
+++ test/crosslink.test
@@ -13,11 +13,10 @@
13 # The first sections run at every level, and the rest need
14 # -assurance stress.
15 require_no_open_checkout
16
17 test_setup
18 source [file join $::testfiledir trunk-fixes.tcl]
19
20 set crosslinkSeq 0
21
22 # Write a file that holds the cards $body and the Z card for them, and
23 # return its name.
@@ -632,13 +631,11 @@
632 ] {
633 set crosslinkG [crosslink_put "D 2026-01-08T10:0[incr crosslinkI]:00.000
634 T +parent $crosslinkM3 $crosslinkValue
635 U alice
636 "]
637 test crosslink-reparent-$crosslinkName {$CODE == 0 && $crosslinkG ne ""} \
638 [sanitizer_trunk_mark $crosslinkName \
639 {two-sha3-short one-sha3-short one-sha1-short}]
640 test_eq crosslink-reparent-$crosslinkName-ignored [fossil_sql "SELECT
641 uuid FROM plink, blob WHERE pid=rid AND isprim AND cid=(SELECT rid
642 FROM blob WHERE uuid='$crosslinkM3')"] $crosslinkM2
643 }
644 fossil rebuild
@@ -686,12 +683,11 @@
686 set crosslinkHash [string trim [fossil_sql "SELECT uuid FROM blob,
687 attachment WHERE rid=attachid ORDER BY rid LIMIT 1"] ']
688 }
689 fossil test-artifact-to-json $crosslinkHash
690 test crosslink-json-$crosslinkKind {$CODE == 0}
691 crosslink_match crosslink-json-$crosslinkKind-text $RESULT $crosslinkWant \
692 [sanitizer_trunk_mark $crosslinkKind tag]
693 }
694 # Every artifact that the repository shows in its timeline has a JSON
695 # form.
696 fossil sql "SELECT uuid FROM blob WHERE rid IN (SELECT objid FROM event)"
697 set crosslinkAll [string map {' {}} $RESULT]
@@ -1314,18 +1310,17 @@
1314 {*reports the input is ok*manifest_parse() worked}
1315
1316 fossil test-parse-manifest $crosslinkEmptyP
1317 crosslink_match crosslink-mcdc-agree-empty-p-parses $RESULT \
1318 {*manifest_parse() worked*}
1319 test crosslink-mcdc-agree-empty-p {![string match *disagree* $RESULT]} \
1320 $::trunkMark
1321
1322 fossil test-parse-manifest wf-signed-no-newline.txt
1323 crosslink_match crosslink-mcdc-agree-signed-no-newline-refused $RESULT \
1324 {*ERROR: not terminated*}
1325 test crosslink-mcdc-agree-signed-no-newline \
1326 {![string match *disagree* $RESULT]} $::trunkMark
1327
1328 # The same for content held by a repository.
1329 fossil init wf.fossil
1330 fossil test-content-put -R wf.fossil wf-signed.txt $crosslinkEmptyP \
1331 wf-signed-no-newline.txt
@@ -1332,11 +1327,11 @@
1332 test crosslink-mcdc-agree-stored {$CODE == 0}
1333 fossil test-parse-all-blobs --wellformed -R wf.fossil
1334 test crosslink-mcdc-agree-stored-checked \
1335 {$CODE == 0 && [regexp {(\d+) tests with} $RESULT all n] && $n >= 3}
1336 crosslink_match crosslink-mcdc-agree-stored-no-errors $RESULT \
1337 {*tests with 0 errors*} $::trunkMark
1338
1339 ###############################################################################
1340 # More values of the "parent" tag. A value that ends in a space names the
1341 # parent before the space. A value long enough to be a hash that is not
1342 # one is ignored. A "parent" tag on a wiki page makes no links.
1343
--- test/crosslink.test
+++ test/crosslink.test
@@ -13,11 +13,10 @@
13 # The first sections run at every level, and the rest need
14 # -assurance stress.
15 require_no_open_checkout
16
17 test_setup
 
18
19 set crosslinkSeq 0
20
21 # Write a file that holds the cards $body and the Z card for them, and
22 # return its name.
@@ -632,13 +631,11 @@
631 ] {
632 set crosslinkG [crosslink_put "D 2026-01-08T10:0[incr crosslinkI]:00.000
633 T +parent $crosslinkM3 $crosslinkValue
634 U alice
635 "]
636 test crosslink-reparent-$crosslinkName {$CODE == 0 && $crosslinkG ne ""}
 
 
637 test_eq crosslink-reparent-$crosslinkName-ignored [fossil_sql "SELECT
638 uuid FROM plink, blob WHERE pid=rid AND isprim AND cid=(SELECT rid
639 FROM blob WHERE uuid='$crosslinkM3')"] $crosslinkM2
640 }
641 fossil rebuild
@@ -686,12 +683,11 @@
683 set crosslinkHash [string trim [fossil_sql "SELECT uuid FROM blob,
684 attachment WHERE rid=attachid ORDER BY rid LIMIT 1"] ']
685 }
686 fossil test-artifact-to-json $crosslinkHash
687 test crosslink-json-$crosslinkKind {$CODE == 0}
688 crosslink_match crosslink-json-$crosslinkKind-text $RESULT $crosslinkWant
 
689 }
690 # Every artifact that the repository shows in its timeline has a JSON
691 # form.
692 fossil sql "SELECT uuid FROM blob WHERE rid IN (SELECT objid FROM event)"
693 set crosslinkAll [string map {' {}} $RESULT]
@@ -1314,18 +1310,17 @@
1310 {*reports the input is ok*manifest_parse() worked}
1311
1312 fossil test-parse-manifest $crosslinkEmptyP
1313 crosslink_match crosslink-mcdc-agree-empty-p-parses $RESULT \
1314 {*manifest_parse() worked*}
1315 test crosslink-mcdc-agree-empty-p {![string match *disagree* $RESULT]}
 
1316
1317 fossil test-parse-manifest wf-signed-no-newline.txt
1318 crosslink_match crosslink-mcdc-agree-signed-no-newline-refused $RESULT \
1319 {*ERROR: not terminated*}
1320 test crosslink-mcdc-agree-signed-no-newline \
1321 {![string match *disagree* $RESULT]}
1322
1323 # The same for content held by a repository.
1324 fossil init wf.fossil
1325 fossil test-content-put -R wf.fossil wf-signed.txt $crosslinkEmptyP \
1326 wf-signed-no-newline.txt
@@ -1332,11 +1327,11 @@
1327 test crosslink-mcdc-agree-stored {$CODE == 0}
1328 fossil test-parse-all-blobs --wellformed -R wf.fossil
1329 test crosslink-mcdc-agree-stored-checked \
1330 {$CODE == 0 && [regexp {(\d+) tests with} $RESULT all n] && $n >= 3}
1331 crosslink_match crosslink-mcdc-agree-stored-no-errors $RESULT \
1332 {*tests with 0 errors*}
1333
1334 ###############################################################################
1335 # More values of the "parent" tag. A value that ends in a space names the
1336 # parent before the space. A value long enough to be a hash that is not
1337 # one is ignored. A "parent" tag on a wiki page makes no links.
1338
+19 -32
--- test/import.test
+++ test/import.test
@@ -7,11 +7,10 @@
77
#
88
99
# The first sections run at every level, and the rest need
1010
# -assurance stress.
1111
test_setup
12
-source [file join $::testfiledir trunk-fixes.tcl]
1312
1413
# A number in the variable-length form of svndiff0: seven bits a byte,
1514
# most significant first, the high bit set on every byte but the last.
1615
#
1716
proc import_varint {n} {
@@ -222,19 +221,19 @@
222221
append importStream "data 4\nimp\nM 100644 :1 f.txt\n\n"
223222
write_file git-artifact.fi $importStream
224223
fossil_raw -seconds 60 import --git git-artifact.fossil git-artifact.fi
225224
test import-git-artifact-file {$CODE == 0}
226225
fossil sql -R git-artifact.fossil "SELECT count(*) FROM event WHERE type='ci'"
227
-test_eq import-git-artifact-one-checkin [string trim $RESULT] 1 $::trunkMark
226
+test_eq import-git-artifact-one-checkin [string trim $RESULT] 1
228227
fossil sql -R git-artifact.fossil \
229228
"SELECT count(*) FROM tag WHERE tagname='sym-planted'"
230
-test_eq import-git-artifact-no-branch [string trim $RESULT] 0 $::trunkMark
229
+test_eq import-git-artifact-no-branch [string trim $RESULT] 0
231230
fossil_raw cat f.txt -R git-artifact.fossil -r trunk
232231
test_eq import-git-artifact-content $RESULT \
233232
[join [list \
234233
"${importArt}# Remove this line to create a well-formed " \
235
- "Fossil control artifact.\n"] ""] $::trunkMark
234
+ "Fossil control artifact.\n"] ""]
236235
237236
###############################################################################
238237
# Input that "fossil import" must refuse with an error and exit code 1.
239238
240239
# Each row: a git stream. The length of a data command is negative, too
@@ -262,21 +261,19 @@
262261
] {
263262
write_file refuse-$importName.fi $importStream
264263
fossil_raw -seconds 60 import --git refuse-$importName.fossil \
265264
refuse-$importName.fi
266265
test import-refuse-git-$importName {$CODE == 1 &&
267
- [string first "bad fast-import line" $RESULT] >= 0} \
268
- [trunk_mark $importName {data-negative data-huge time-past-9999
269
- time-13-digits time-no-space}]
266
+ [string first "bad fast-import line" $RESULT] >= 0}
270267
}
271268
272269
# A commit command whose name is 992 bytes long, with no slash after its
273270
# fifth byte and no newline, is read within the name. The commit has no
274271
# data and is not made.
275272
write_file git-ref-long.fi "commit [string repeat a 992]"
276273
fossil_raw -seconds 60 import --git git-ref-long.fossil git-ref-long.fi
277
-test import-git-ref-long {$CODE == 0} [sanitizer_trunk_mark]
274
+test import-git-ref-long {$CODE == 0}
278275
279276
# Each row: an svn dump. A header line has no newline after its value,
280277
# because the dump ends there, a zero byte comes first, or the line is
281278
# longer than the importer reads at once; a file on the trunk has no
282279
# Node-action.
@@ -296,11 +293,11 @@
296293
] {
297294
write_file refuse-$importName.dump $importDump
298295
fossil_raw -seconds 60 import --svn refuse-$importName.fossil \
299296
refuse-$importName.dump
300297
test import-refuse-svn-$importName {$CODE == 1 &&
301
- [string first "svn-dump data format broken" $RESULT] >= 0} $::trunkMark
298
+ [string first "svn-dump data format broken" $RESULT] >= 0}
302299
}
303300
304301
# A file outside trunk, branches and tags is passed over even when it has
305302
# no Node-action.
306303
#
@@ -321,11 +318,11 @@
321318
"Content-length: 1\n\nx\n\n"] ""]
322319
foreach importName {trunk branches tags} {
323320
fossil_raw -seconds 60 import --svn --$importName "" \
324321
refuse-$importName.fossil base.dump
325322
test import-refuse-svn-empty-$importName {$CODE == 1 && [string first \
326
- "may be empty only with a non-empty --base" $RESULT] >= 0} $::trunkMark
323
+ "may be empty only with a non-empty --base" $RESULT] >= 0}
327324
}
328325
fossil_raw -seconds 60 import --svn --base proj --trunk "" base.fossil base.dump
329326
test import-svn-base-empty-trunk {$CODE == 0}
330327
fossil sql -R base.fossil "SELECT group_concat(f.filename, ' ')
331328
FROM event e, blob b, files_of_checkin(b.uuid) f WHERE b.rid=e.objid"
@@ -643,12 +640,11 @@
643640
644641
# Without --force an existing repository is not written over, and the
645642
# command says so rather than give an error from the database.
646643
#
647644
fossil_raw -seconds 60 import --git names.fossil names.fi
648
-test import-git-exists {$CODE == 1 && [holds_strings $RESULT {!SQLITE_ERROR}]} \
649
- $::trunkMark
645
+test import-git-exists {$CODE == 1 && [holds_strings $RESULT {!SQLITE_ERROR}]}
650646
test_eq import-git-exists-untouched [import_checkins names] "names fewer"
651647
652648
# With --force an existing repository is replaced. The stream comes on
653649
# standard input when no file is named.
654650
#
@@ -738,12 +734,11 @@
738734
append importStream [import_commit refs/heads/master 2 orphan \
739735
"from :5\nM 100644 :1 a\n"]
740736
fossil_raw -seconds 60 -input $importStream import --git \
741737
--import-marks zero.marks zero.fossil
742738
test import-git-import-marks-zero {$CODE == 1 &&
743
- [string first "error importing marks from file: zero.marks" $RESULT] >= 0} \
744
- $::trunkMark
739
+ [string first "error importing marks from file: zero.marks" $RESULT] >= 0}
745740
746741
# Each row: a marks line that is not a commit or file mark of Fossil's,
747742
# which "fossil export --import-marks" refuses.
748743
#
749744
fossil init marks-export.fossil
@@ -754,12 +749,11 @@
754749
] {
755750
write_file bad-$importName.marks "$importLine\n"
756751
fossil_raw -seconds 60 export --git --import-marks bad-$importName.marks \
757752
-R marks-export.fossil
758753
test import-export-marks-$importName {$CODE == 1 && [string first \
759
- "error importing marks from file: bad-$importName.marks" $RESULT] >= 0} \
760
- $::trunkMark
754
+ "error importing marks from file: bad-$importName.marks" $RESULT] >= 0}
761755
}
762756
763757
# Marks may name a check-in made by "fossil commit", whose files carry no
764758
# permission, and the files of such a parent are kept. A commit whose
765759
# "from" is the mark of a file keeps nothing from it.
@@ -796,12 +790,11 @@
796790
append importStream [import_commit refs/heads/master 2 first "M 100644 :1 a\n"]
797791
write_file default.fi $importStream
798792
fossil_raw -seconds 60 import default.fossil default.fi
799793
test import-default-format {$CODE == 0}
800794
test_eq import-default-format-checkins [import_checkins default] first
801
-test_eq import-default-format-tags [import_tags default first] "master trunk" \
802
- $::trunkMark
795
+test_eq import-default-format-tags [import_tags default first] "master trunk"
803796
804797
# A ref of fewer than five bytes names its branch.
805798
#
806799
set importStream [import_blob 1 "hello\n"]
807800
append importStream [import_commit refs/heads/master 2 first \
@@ -808,11 +801,11 @@
808801
"M 100644 :1 a-long-name-for-a-file\n"]
809802
append importStream [import_commit x 3 second "M 100644 :1 b\n"]
810803
import_git shortref $importStream
811804
test_eq import-git-short-ref [import_sql shortref "SELECT value
812805
FROM event, tagxref WHERE rid=objid AND tagxref.tagid=8
813
- AND comment='second'"] x $::trunkMark
806
+ AND comment='second'"] x
814807
815808
# A file command acts on a file that an earlier line of the same commit
816809
# made: D removes it, C copies it and R renames it. Fossil applies D, C
817810
# and R only to the files of the parent check-in: gone and old stay, dst
818811
# and new are not made.
@@ -1076,11 +1069,11 @@
10761069
}
10771070
10781071
test_eq import-svn-named-copy-props [import_perm named four run3] x
10791072
10801073
# A file that is copied keeps the permission of the file it comes from.
1081
-test_eq import-svn-named-copy-perm [import_perm named four run2] x $::trunkMark
1074
+test_eq import-svn-named-copy-perm [import_perm named four run2] x
10821075
10831076
# With --flat every path is a file of the trunk.
10841077
import_svn flat $importDump --flat
10851078
test import-svn-flat {$CODE == 0}
10861079
test_eq import-svn-flat-files [import_files flat two] "elsewhere/y,\
@@ -1103,12 +1096,11 @@
11031096
#
11041097
import_svn dircopy \
11051098
"$importHead[import_r 1 one][import_file add trunk/d/f "f\n"][import_r \
11061099
2 two][import_copy dir trunk/d2 trunk/d 1]"
11071100
test import-svn-dir-copy {$CODE == 0}
1108
-test_eq import-svn-dir-copy-files [import_files dircopy two] "d/f, d2/f" \
1109
- $::trunkMark
1101
+test_eq import-svn-dir-copy-files [import_files dircopy two] "d/f, d2/f"
11101102
11111103
# --ignore-tree leaves out a directory and what is in it, on the trunk
11121104
# and on a branch, and no other path that begins with the same letters.
11131105
# An empty --ignore-tree names nothing.
11141106
#
@@ -1222,14 +1214,11 @@
12221214
"SVN\000[import_window 0 5 5 {0x05 0} {}]"]" \
12231215
"Don't know how to handle NULL input" \
12241216
] {
12251217
import_svn bad-$importName $importDump
12261218
test import-svn-bad-$importName {$CODE == 1 &&
1227
- [string first $importError $RESULT] >= 0} \
1228
- [trunk_mark $importName \
1229
- {rev-over-31-bits rev-eleven-digits
1230
- node-before-revision}]
1219
+ [string first $importError $RESULT] >= 0}
12311220
}
12321221
12331222
# Each row: the bytes of a property block before its end mark, which make
12341223
# the block malformed. A length may be negative, reach past the block or
12351224
# not be followed by a newline, a zero byte may come before the newline
@@ -1305,11 +1294,11 @@
13051294
"a.txt, run.sh x"
13061295
13071296
# A copied file keeps the executable permission of its source when the
13081297
# node gives no properties or only a property delta.
13091298
test_eq import-svn-copy-props [import_files quiet-nodes two] \
1310
- "a.txt, delta x, full, nodelta, none x, run.sh x" $::trunkMark
1299
+ "a.txt, delta x, full, nodelta, none x, run.sh x"
13111300
13121301
# Nothing is left of the tags and the branch that were never made: the
13131302
# timeline holds the three check-ins and the tag that closes trunk when
13141303
# it is deleted.
13151304
test_eq import-svn-never-made [import_sql quiet-nodes "SELECT count(*)
@@ -1328,20 +1317,18 @@
13281317
# becomes a check-in.
13291318
#
13301319
import_svn odd-path "$importR1[import_file add trunk/./a "a\n"][import_r 2 \
13311320
two][import_file add trunk/b "b\n"]"
13321321
test import-svn-odd-path {$CODE == 1 &&
1333
- [string first "svn path is not a valid file name" $RESULT] >= 0} \
1334
- $::trunkMark
1322
+ [string first "svn path is not a valid file name" $RESULT] >= 0}
13351323
13361324
# So is a file that is added with no content and no source.
13371325
#
13381326
import_svn no-content "$importR1[import_file add trunk/a "a\n"][import_record \
13391327
{Node-path trunk/n Node-kind file Node-action add}]"
13401328
test import-svn-no-content {$CODE == 1 &&
1341
- [string first "svn file has no content and no source" $RESULT] >= 0} \
1342
- $::trunkMark
1329
+ [string first "svn file has no content and no source" $RESULT] >= 0}
13431330
13441331
###############################################################################
13451332
# A history made by Subversion, dumped with and without deltas: files, an
13461333
# executable and a link on the trunk, a branch and a tag copied from it,
13471334
# a change, a renamed file, and the branch deleted.
@@ -1389,11 +1376,11 @@
13891376
test_eq import-$importName-four "[import_sql $importName "SELECT
13901377
group_concat(f.filename, ' ') FROM event e, blob b,
13911378
files_of_checkin(b.uuid) f WHERE e.comment='four' AND b.rid=e.objid"];\
13921379
[import_cat $importName four a.txt]" "a.txt link moved.sh; alpha2\n"
13931380
test_eq import-$importName-four-perm \
1394
- [import_perm $importName four moved.sh] x $::trunkMark
1381
+ [import_perm $importName four moved.sh] x
13951382
}
13961383
}
13971384
13981385
###############################################################################
13991386
# A history made by git and written by "git fast-export": files whose
14001387
--- test/import.test
+++ test/import.test
@@ -7,11 +7,10 @@
7 #
8
9 # The first sections run at every level, and the rest need
10 # -assurance stress.
11 test_setup
12 source [file join $::testfiledir trunk-fixes.tcl]
13
14 # A number in the variable-length form of svndiff0: seven bits a byte,
15 # most significant first, the high bit set on every byte but the last.
16 #
17 proc import_varint {n} {
@@ -222,19 +221,19 @@
222 append importStream "data 4\nimp\nM 100644 :1 f.txt\n\n"
223 write_file git-artifact.fi $importStream
224 fossil_raw -seconds 60 import --git git-artifact.fossil git-artifact.fi
225 test import-git-artifact-file {$CODE == 0}
226 fossil sql -R git-artifact.fossil "SELECT count(*) FROM event WHERE type='ci'"
227 test_eq import-git-artifact-one-checkin [string trim $RESULT] 1 $::trunkMark
228 fossil sql -R git-artifact.fossil \
229 "SELECT count(*) FROM tag WHERE tagname='sym-planted'"
230 test_eq import-git-artifact-no-branch [string trim $RESULT] 0 $::trunkMark
231 fossil_raw cat f.txt -R git-artifact.fossil -r trunk
232 test_eq import-git-artifact-content $RESULT \
233 [join [list \
234 "${importArt}# Remove this line to create a well-formed " \
235 "Fossil control artifact.\n"] ""] $::trunkMark
236
237 ###############################################################################
238 # Input that "fossil import" must refuse with an error and exit code 1.
239
240 # Each row: a git stream. The length of a data command is negative, too
@@ -262,21 +261,19 @@
262 ] {
263 write_file refuse-$importName.fi $importStream
264 fossil_raw -seconds 60 import --git refuse-$importName.fossil \
265 refuse-$importName.fi
266 test import-refuse-git-$importName {$CODE == 1 &&
267 [string first "bad fast-import line" $RESULT] >= 0} \
268 [trunk_mark $importName {data-negative data-huge time-past-9999
269 time-13-digits time-no-space}]
270 }
271
272 # A commit command whose name is 992 bytes long, with no slash after its
273 # fifth byte and no newline, is read within the name. The commit has no
274 # data and is not made.
275 write_file git-ref-long.fi "commit [string repeat a 992]"
276 fossil_raw -seconds 60 import --git git-ref-long.fossil git-ref-long.fi
277 test import-git-ref-long {$CODE == 0} [sanitizer_trunk_mark]
278
279 # Each row: an svn dump. A header line has no newline after its value,
280 # because the dump ends there, a zero byte comes first, or the line is
281 # longer than the importer reads at once; a file on the trunk has no
282 # Node-action.
@@ -296,11 +293,11 @@
296 ] {
297 write_file refuse-$importName.dump $importDump
298 fossil_raw -seconds 60 import --svn refuse-$importName.fossil \
299 refuse-$importName.dump
300 test import-refuse-svn-$importName {$CODE == 1 &&
301 [string first "svn-dump data format broken" $RESULT] >= 0} $::trunkMark
302 }
303
304 # A file outside trunk, branches and tags is passed over even when it has
305 # no Node-action.
306 #
@@ -321,11 +318,11 @@
321 "Content-length: 1\n\nx\n\n"] ""]
322 foreach importName {trunk branches tags} {
323 fossil_raw -seconds 60 import --svn --$importName "" \
324 refuse-$importName.fossil base.dump
325 test import-refuse-svn-empty-$importName {$CODE == 1 && [string first \
326 "may be empty only with a non-empty --base" $RESULT] >= 0} $::trunkMark
327 }
328 fossil_raw -seconds 60 import --svn --base proj --trunk "" base.fossil base.dump
329 test import-svn-base-empty-trunk {$CODE == 0}
330 fossil sql -R base.fossil "SELECT group_concat(f.filename, ' ')
331 FROM event e, blob b, files_of_checkin(b.uuid) f WHERE b.rid=e.objid"
@@ -643,12 +640,11 @@
643
644 # Without --force an existing repository is not written over, and the
645 # command says so rather than give an error from the database.
646 #
647 fossil_raw -seconds 60 import --git names.fossil names.fi
648 test import-git-exists {$CODE == 1 && [holds_strings $RESULT {!SQLITE_ERROR}]} \
649 $::trunkMark
650 test_eq import-git-exists-untouched [import_checkins names] "names fewer"
651
652 # With --force an existing repository is replaced. The stream comes on
653 # standard input when no file is named.
654 #
@@ -738,12 +734,11 @@
738 append importStream [import_commit refs/heads/master 2 orphan \
739 "from :5\nM 100644 :1 a\n"]
740 fossil_raw -seconds 60 -input $importStream import --git \
741 --import-marks zero.marks zero.fossil
742 test import-git-import-marks-zero {$CODE == 1 &&
743 [string first "error importing marks from file: zero.marks" $RESULT] >= 0} \
744 $::trunkMark
745
746 # Each row: a marks line that is not a commit or file mark of Fossil's,
747 # which "fossil export --import-marks" refuses.
748 #
749 fossil init marks-export.fossil
@@ -754,12 +749,11 @@
754 ] {
755 write_file bad-$importName.marks "$importLine\n"
756 fossil_raw -seconds 60 export --git --import-marks bad-$importName.marks \
757 -R marks-export.fossil
758 test import-export-marks-$importName {$CODE == 1 && [string first \
759 "error importing marks from file: bad-$importName.marks" $RESULT] >= 0} \
760 $::trunkMark
761 }
762
763 # Marks may name a check-in made by "fossil commit", whose files carry no
764 # permission, and the files of such a parent are kept. A commit whose
765 # "from" is the mark of a file keeps nothing from it.
@@ -796,12 +790,11 @@
796 append importStream [import_commit refs/heads/master 2 first "M 100644 :1 a\n"]
797 write_file default.fi $importStream
798 fossil_raw -seconds 60 import default.fossil default.fi
799 test import-default-format {$CODE == 0}
800 test_eq import-default-format-checkins [import_checkins default] first
801 test_eq import-default-format-tags [import_tags default first] "master trunk" \
802 $::trunkMark
803
804 # A ref of fewer than five bytes names its branch.
805 #
806 set importStream [import_blob 1 "hello\n"]
807 append importStream [import_commit refs/heads/master 2 first \
@@ -808,11 +801,11 @@
808 "M 100644 :1 a-long-name-for-a-file\n"]
809 append importStream [import_commit x 3 second "M 100644 :1 b\n"]
810 import_git shortref $importStream
811 test_eq import-git-short-ref [import_sql shortref "SELECT value
812 FROM event, tagxref WHERE rid=objid AND tagxref.tagid=8
813 AND comment='second'"] x $::trunkMark
814
815 # A file command acts on a file that an earlier line of the same commit
816 # made: D removes it, C copies it and R renames it. Fossil applies D, C
817 # and R only to the files of the parent check-in: gone and old stay, dst
818 # and new are not made.
@@ -1076,11 +1069,11 @@
1076 }
1077
1078 test_eq import-svn-named-copy-props [import_perm named four run3] x
1079
1080 # A file that is copied keeps the permission of the file it comes from.
1081 test_eq import-svn-named-copy-perm [import_perm named four run2] x $::trunkMark
1082
1083 # With --flat every path is a file of the trunk.
1084 import_svn flat $importDump --flat
1085 test import-svn-flat {$CODE == 0}
1086 test_eq import-svn-flat-files [import_files flat two] "elsewhere/y,\
@@ -1103,12 +1096,11 @@
1103 #
1104 import_svn dircopy \
1105 "$importHead[import_r 1 one][import_file add trunk/d/f "f\n"][import_r \
1106 2 two][import_copy dir trunk/d2 trunk/d 1]"
1107 test import-svn-dir-copy {$CODE == 0}
1108 test_eq import-svn-dir-copy-files [import_files dircopy two] "d/f, d2/f" \
1109 $::trunkMark
1110
1111 # --ignore-tree leaves out a directory and what is in it, on the trunk
1112 # and on a branch, and no other path that begins with the same letters.
1113 # An empty --ignore-tree names nothing.
1114 #
@@ -1222,14 +1214,11 @@
1222 "SVN\000[import_window 0 5 5 {0x05 0} {}]"]" \
1223 "Don't know how to handle NULL input" \
1224 ] {
1225 import_svn bad-$importName $importDump
1226 test import-svn-bad-$importName {$CODE == 1 &&
1227 [string first $importError $RESULT] >= 0} \
1228 [trunk_mark $importName \
1229 {rev-over-31-bits rev-eleven-digits
1230 node-before-revision}]
1231 }
1232
1233 # Each row: the bytes of a property block before its end mark, which make
1234 # the block malformed. A length may be negative, reach past the block or
1235 # not be followed by a newline, a zero byte may come before the newline
@@ -1305,11 +1294,11 @@
1305 "a.txt, run.sh x"
1306
1307 # A copied file keeps the executable permission of its source when the
1308 # node gives no properties or only a property delta.
1309 test_eq import-svn-copy-props [import_files quiet-nodes two] \
1310 "a.txt, delta x, full, nodelta, none x, run.sh x" $::trunkMark
1311
1312 # Nothing is left of the tags and the branch that were never made: the
1313 # timeline holds the three check-ins and the tag that closes trunk when
1314 # it is deleted.
1315 test_eq import-svn-never-made [import_sql quiet-nodes "SELECT count(*)
@@ -1328,20 +1317,18 @@
1328 # becomes a check-in.
1329 #
1330 import_svn odd-path "$importR1[import_file add trunk/./a "a\n"][import_r 2 \
1331 two][import_file add trunk/b "b\n"]"
1332 test import-svn-odd-path {$CODE == 1 &&
1333 [string first "svn path is not a valid file name" $RESULT] >= 0} \
1334 $::trunkMark
1335
1336 # So is a file that is added with no content and no source.
1337 #
1338 import_svn no-content "$importR1[import_file add trunk/a "a\n"][import_record \
1339 {Node-path trunk/n Node-kind file Node-action add}]"
1340 test import-svn-no-content {$CODE == 1 &&
1341 [string first "svn file has no content and no source" $RESULT] >= 0} \
1342 $::trunkMark
1343
1344 ###############################################################################
1345 # A history made by Subversion, dumped with and without deltas: files, an
1346 # executable and a link on the trunk, a branch and a tag copied from it,
1347 # a change, a renamed file, and the branch deleted.
@@ -1389,11 +1376,11 @@
1389 test_eq import-$importName-four "[import_sql $importName "SELECT
1390 group_concat(f.filename, ' ') FROM event e, blob b,
1391 files_of_checkin(b.uuid) f WHERE e.comment='four' AND b.rid=e.objid"];\
1392 [import_cat $importName four a.txt]" "a.txt link moved.sh; alpha2\n"
1393 test_eq import-$importName-four-perm \
1394 [import_perm $importName four moved.sh] x $::trunkMark
1395 }
1396 }
1397
1398 ###############################################################################
1399 # A history made by git and written by "git fast-export": files whose
1400
--- test/import.test
+++ test/import.test
@@ -7,11 +7,10 @@
7 #
8
9 # The first sections run at every level, and the rest need
10 # -assurance stress.
11 test_setup
 
12
13 # A number in the variable-length form of svndiff0: seven bits a byte,
14 # most significant first, the high bit set on every byte but the last.
15 #
16 proc import_varint {n} {
@@ -222,19 +221,19 @@
221 append importStream "data 4\nimp\nM 100644 :1 f.txt\n\n"
222 write_file git-artifact.fi $importStream
223 fossil_raw -seconds 60 import --git git-artifact.fossil git-artifact.fi
224 test import-git-artifact-file {$CODE == 0}
225 fossil sql -R git-artifact.fossil "SELECT count(*) FROM event WHERE type='ci'"
226 test_eq import-git-artifact-one-checkin [string trim $RESULT] 1
227 fossil sql -R git-artifact.fossil \
228 "SELECT count(*) FROM tag WHERE tagname='sym-planted'"
229 test_eq import-git-artifact-no-branch [string trim $RESULT] 0
230 fossil_raw cat f.txt -R git-artifact.fossil -r trunk
231 test_eq import-git-artifact-content $RESULT \
232 [join [list \
233 "${importArt}# Remove this line to create a well-formed " \
234 "Fossil control artifact.\n"] ""]
235
236 ###############################################################################
237 # Input that "fossil import" must refuse with an error and exit code 1.
238
239 # Each row: a git stream. The length of a data command is negative, too
@@ -262,21 +261,19 @@
261 ] {
262 write_file refuse-$importName.fi $importStream
263 fossil_raw -seconds 60 import --git refuse-$importName.fossil \
264 refuse-$importName.fi
265 test import-refuse-git-$importName {$CODE == 1 &&
266 [string first "bad fast-import line" $RESULT] >= 0}
 
 
267 }
268
269 # A commit command whose name is 992 bytes long, with no slash after its
270 # fifth byte and no newline, is read within the name. The commit has no
271 # data and is not made.
272 write_file git-ref-long.fi "commit [string repeat a 992]"
273 fossil_raw -seconds 60 import --git git-ref-long.fossil git-ref-long.fi
274 test import-git-ref-long {$CODE == 0}
275
276 # Each row: an svn dump. A header line has no newline after its value,
277 # because the dump ends there, a zero byte comes first, or the line is
278 # longer than the importer reads at once; a file on the trunk has no
279 # Node-action.
@@ -296,11 +293,11 @@
293 ] {
294 write_file refuse-$importName.dump $importDump
295 fossil_raw -seconds 60 import --svn refuse-$importName.fossil \
296 refuse-$importName.dump
297 test import-refuse-svn-$importName {$CODE == 1 &&
298 [string first "svn-dump data format broken" $RESULT] >= 0}
299 }
300
301 # A file outside trunk, branches and tags is passed over even when it has
302 # no Node-action.
303 #
@@ -321,11 +318,11 @@
318 "Content-length: 1\n\nx\n\n"] ""]
319 foreach importName {trunk branches tags} {
320 fossil_raw -seconds 60 import --svn --$importName "" \
321 refuse-$importName.fossil base.dump
322 test import-refuse-svn-empty-$importName {$CODE == 1 && [string first \
323 "may be empty only with a non-empty --base" $RESULT] >= 0}
324 }
325 fossil_raw -seconds 60 import --svn --base proj --trunk "" base.fossil base.dump
326 test import-svn-base-empty-trunk {$CODE == 0}
327 fossil sql -R base.fossil "SELECT group_concat(f.filename, ' ')
328 FROM event e, blob b, files_of_checkin(b.uuid) f WHERE b.rid=e.objid"
@@ -643,12 +640,11 @@
640
641 # Without --force an existing repository is not written over, and the
642 # command says so rather than give an error from the database.
643 #
644 fossil_raw -seconds 60 import --git names.fossil names.fi
645 test import-git-exists {$CODE == 1 && [holds_strings $RESULT {!SQLITE_ERROR}]}
 
646 test_eq import-git-exists-untouched [import_checkins names] "names fewer"
647
648 # With --force an existing repository is replaced. The stream comes on
649 # standard input when no file is named.
650 #
@@ -738,12 +734,11 @@
734 append importStream [import_commit refs/heads/master 2 orphan \
735 "from :5\nM 100644 :1 a\n"]
736 fossil_raw -seconds 60 -input $importStream import --git \
737 --import-marks zero.marks zero.fossil
738 test import-git-import-marks-zero {$CODE == 1 &&
739 [string first "error importing marks from file: zero.marks" $RESULT] >= 0}
 
740
741 # Each row: a marks line that is not a commit or file mark of Fossil's,
742 # which "fossil export --import-marks" refuses.
743 #
744 fossil init marks-export.fossil
@@ -754,12 +749,11 @@
749 ] {
750 write_file bad-$importName.marks "$importLine\n"
751 fossil_raw -seconds 60 export --git --import-marks bad-$importName.marks \
752 -R marks-export.fossil
753 test import-export-marks-$importName {$CODE == 1 && [string first \
754 "error importing marks from file: bad-$importName.marks" $RESULT] >= 0}
 
755 }
756
757 # Marks may name a check-in made by "fossil commit", whose files carry no
758 # permission, and the files of such a parent are kept. A commit whose
759 # "from" is the mark of a file keeps nothing from it.
@@ -796,12 +790,11 @@
790 append importStream [import_commit refs/heads/master 2 first "M 100644 :1 a\n"]
791 write_file default.fi $importStream
792 fossil_raw -seconds 60 import default.fossil default.fi
793 test import-default-format {$CODE == 0}
794 test_eq import-default-format-checkins [import_checkins default] first
795 test_eq import-default-format-tags [import_tags default first] "master trunk"
 
796
797 # A ref of fewer than five bytes names its branch.
798 #
799 set importStream [import_blob 1 "hello\n"]
800 append importStream [import_commit refs/heads/master 2 first \
@@ -808,11 +801,11 @@
801 "M 100644 :1 a-long-name-for-a-file\n"]
802 append importStream [import_commit x 3 second "M 100644 :1 b\n"]
803 import_git shortref $importStream
804 test_eq import-git-short-ref [import_sql shortref "SELECT value
805 FROM event, tagxref WHERE rid=objid AND tagxref.tagid=8
806 AND comment='second'"] x
807
808 # A file command acts on a file that an earlier line of the same commit
809 # made: D removes it, C copies it and R renames it. Fossil applies D, C
810 # and R only to the files of the parent check-in: gone and old stay, dst
811 # and new are not made.
@@ -1076,11 +1069,11 @@
1069 }
1070
1071 test_eq import-svn-named-copy-props [import_perm named four run3] x
1072
1073 # A file that is copied keeps the permission of the file it comes from.
1074 test_eq import-svn-named-copy-perm [import_perm named four run2] x
1075
1076 # With --flat every path is a file of the trunk.
1077 import_svn flat $importDump --flat
1078 test import-svn-flat {$CODE == 0}
1079 test_eq import-svn-flat-files [import_files flat two] "elsewhere/y,\
@@ -1103,12 +1096,11 @@
1096 #
1097 import_svn dircopy \
1098 "$importHead[import_r 1 one][import_file add trunk/d/f "f\n"][import_r \
1099 2 two][import_copy dir trunk/d2 trunk/d 1]"
1100 test import-svn-dir-copy {$CODE == 0}
1101 test_eq import-svn-dir-copy-files [import_files dircopy two] "d/f, d2/f"
 
1102
1103 # --ignore-tree leaves out a directory and what is in it, on the trunk
1104 # and on a branch, and no other path that begins with the same letters.
1105 # An empty --ignore-tree names nothing.
1106 #
@@ -1222,14 +1214,11 @@
1214 "SVN\000[import_window 0 5 5 {0x05 0} {}]"]" \
1215 "Don't know how to handle NULL input" \
1216 ] {
1217 import_svn bad-$importName $importDump
1218 test import-svn-bad-$importName {$CODE == 1 &&
1219 [string first $importError $RESULT] >= 0}
 
 
 
1220 }
1221
1222 # Each row: the bytes of a property block before its end mark, which make
1223 # the block malformed. A length may be negative, reach past the block or
1224 # not be followed by a newline, a zero byte may come before the newline
@@ -1305,11 +1294,11 @@
1294 "a.txt, run.sh x"
1295
1296 # A copied file keeps the executable permission of its source when the
1297 # node gives no properties or only a property delta.
1298 test_eq import-svn-copy-props [import_files quiet-nodes two] \
1299 "a.txt, delta x, full, nodelta, none x, run.sh x"
1300
1301 # Nothing is left of the tags and the branch that were never made: the
1302 # timeline holds the three check-ins and the tag that closes trunk when
1303 # it is deleted.
1304 test_eq import-svn-never-made [import_sql quiet-nodes "SELECT count(*)
@@ -1328,20 +1317,18 @@
1317 # becomes a check-in.
1318 #
1319 import_svn odd-path "$importR1[import_file add trunk/./a "a\n"][import_r 2 \
1320 two][import_file add trunk/b "b\n"]"
1321 test import-svn-odd-path {$CODE == 1 &&
1322 [string first "svn path is not a valid file name" $RESULT] >= 0}
 
1323
1324 # So is a file that is added with no content and no source.
1325 #
1326 import_svn no-content "$importR1[import_file add trunk/a "a\n"][import_record \
1327 {Node-path trunk/n Node-kind file Node-action add}]"
1328 test import-svn-no-content {$CODE == 1 &&
1329 [string first "svn file has no content and no source" $RESULT] >= 0}
 
1330
1331 ###############################################################################
1332 # A history made by Subversion, dumped with and without deltas: files, an
1333 # executable and a link on the trunk, a branch and a tag copied from it,
1334 # a change, a renamed file, and the branch deleted.
@@ -1389,11 +1376,11 @@
1376 test_eq import-$importName-four "[import_sql $importName "SELECT
1377 group_concat(f.filename, ' ') FROM event e, blob b,
1378 files_of_checkin(b.uuid) f WHERE e.comment='four' AND b.rid=e.objid"];\
1379 [import_cat $importName four a.txt]" "a.txt link moved.sh; alpha2\n"
1380 test_eq import-$importName-four-perm \
1381 [import_perm $importName four moved.sh] x
1382 }
1383 }
1384
1385 ###############################################################################
1386 # A history made by git and written by "git fast-export": files whose
1387
+8 -12
--- test/login.test
+++ test/login.test
@@ -17,11 +17,10 @@
1717
}
1818
1919
require_no_open_checkout
2020
2121
test_setup
22
-source [file join $::testfiledir trunk-fixes.tcl]
2322
2423
set loginRepo [file join [pwd] .rep.fossil]
2524
2625
# A user with Read, Write and Password capability, and a Setup user.
2726
fossil user new loginbob [email protected] bobpw
@@ -469,12 +468,11 @@
469468
} {
470469
set loginReply [login_get /test-env \
471470
[list "Cookie: $loginCookieName=$loginCkValue"]]
472471
test login-cookie-bad-$loginCkName {$CODE == 0
473472
&& [reply_status $loginReply] eq "HTTP/1.0 200 OK"
474
- && [login_who $loginReply] eq "nobody"} \
475
- [sanitizer_trunk_mark $loginCkName {slash end-slash}]
473
+ && [login_who $loginReply] eq "nobody"}
476474
}
477475
478476
###############################################################################
479477
# Where a login goes afterwards when the request carries "fossil-goto", as a
480478
# query parameter, a form field or a cookie: to that address if it is on this
@@ -497,26 +495,25 @@
497495
same-site http://x/timeline http://x/timeline \
498496
] {
499497
set loginReply [login_get \
500498
"/login?u=loginbob&p=newbobpw&fossil-goto=$loginGoTarget"]
501499
test_eq login-goto-query-$loginGoName [reply_header $loginReply Location] \
502
- $loginGoWant [trunk_mark $loginGoName {other-site host-prefix}]
500
+ $loginGoWant
503501
set loginReply [login_form loginbob newbobpw "fossil-goto=$loginGoTarget"]
504502
test_eq login-goto-form-$loginGoName [reply_header $loginReply Location] \
505
- $loginGoWant [trunk_mark $loginGoName {other-site host-prefix}]
503
+ $loginGoWant
506504
set loginReply [login_post /login "u=loginbob&p=newbobpw&in=Login" \
507505
[list "Cookie: fossil-goto=$loginGoTarget"]]
508506
test_eq login-goto-cookie-$loginGoName [reply_header $loginReply Location] \
509
- $loginGoWant [trunk_mark $loginGoName {other-site host-prefix}]
507
+ $loginGoWant
510508
set loginReply [login_get "/login?$loginAnon&fossil-goto=$loginGoTarget"]
511509
test login-goto-anonymous-$loginGoName \
512510
{[string match "*anonymous*" [reply_header $loginReply Set-Cookie]]
513
- && [reply_header $loginReply Location] eq $loginGoWant} \
514
- [trunk_mark $loginGoName {other-site host-prefix}]
511
+ && [reply_header $loginReply Location] eq $loginGoWant}
515512
set loginReply [login_get "/ityaar?$loginRobot&fossil-goto=$loginGoTarget"]
516513
test_eq login-goto-ityaar-$loginGoName [reply_header $loginReply Location] \
517
- $loginGoWant [trunk_mark $loginGoName {other-site host-prefix}]
514
+ $loginGoWant
518515
}
519516
520517
# The captcha page at /honeypot remembers the address asked for in a
521518
# "fossil-goto" cookie, and a right answer sent with that cookie goes there.
522519
set loginReply [login_get /honeypot?x=1]
@@ -1326,11 +1323,11 @@
13261323
base-more http://xy $loginHome \
13271324
other http://y/ $loginHome \
13281325
] {
13291326
test_eq login-goto-$loginFgName [reply_header [login_get \
13301327
"/login?u=loginbob&p=bobfinal&fossil-goto=$loginFgTarget"] Location] \
1331
- $loginFgWant [trunk_mark $loginFgName {base-more other}]
1328
+ $loginFgWant
13321329
}
13331330
13341331
# A GET with "out" does not log out.
13351332
test login-logout-get {[string match \
13361333
"*Currently logged in as <b>loginbob</b>*" \
@@ -1553,12 +1550,11 @@
15531550
end-slash "[string repeat a 50]/" \
15541551
] {
15551552
set loginReply [login_get "/ityaar?captchaseed=$loginSeed&captcha=zzzzzzzz" \
15561553
[list "Cookie: $loginGrpCookie=$loginWfValue"]]
15571554
test login-group-wellformed-$loginWfName \
1558
- {[string match "*Prove that you are human*" $loginReply]} \
1559
- [sanitizer_trunk_mark $loginWfName end-slash]
1555
+ {[string match "*Prove that you are human*" $loginReply]}
15601556
}
15611557
fossil login-group leave
15621558
15631559
# An empty login-group subcommand is unknown.
15641560
fossil_raw login-group ""
15651561
--- test/login.test
+++ test/login.test
@@ -17,11 +17,10 @@
17 }
18
19 require_no_open_checkout
20
21 test_setup
22 source [file join $::testfiledir trunk-fixes.tcl]
23
24 set loginRepo [file join [pwd] .rep.fossil]
25
26 # A user with Read, Write and Password capability, and a Setup user.
27 fossil user new loginbob [email protected] bobpw
@@ -469,12 +468,11 @@
469 } {
470 set loginReply [login_get /test-env \
471 [list "Cookie: $loginCookieName=$loginCkValue"]]
472 test login-cookie-bad-$loginCkName {$CODE == 0
473 && [reply_status $loginReply] eq "HTTP/1.0 200 OK"
474 && [login_who $loginReply] eq "nobody"} \
475 [sanitizer_trunk_mark $loginCkName {slash end-slash}]
476 }
477
478 ###############################################################################
479 # Where a login goes afterwards when the request carries "fossil-goto", as a
480 # query parameter, a form field or a cookie: to that address if it is on this
@@ -497,26 +495,25 @@
497 same-site http://x/timeline http://x/timeline \
498 ] {
499 set loginReply [login_get \
500 "/login?u=loginbob&p=newbobpw&fossil-goto=$loginGoTarget"]
501 test_eq login-goto-query-$loginGoName [reply_header $loginReply Location] \
502 $loginGoWant [trunk_mark $loginGoName {other-site host-prefix}]
503 set loginReply [login_form loginbob newbobpw "fossil-goto=$loginGoTarget"]
504 test_eq login-goto-form-$loginGoName [reply_header $loginReply Location] \
505 $loginGoWant [trunk_mark $loginGoName {other-site host-prefix}]
506 set loginReply [login_post /login "u=loginbob&p=newbobpw&in=Login" \
507 [list "Cookie: fossil-goto=$loginGoTarget"]]
508 test_eq login-goto-cookie-$loginGoName [reply_header $loginReply Location] \
509 $loginGoWant [trunk_mark $loginGoName {other-site host-prefix}]
510 set loginReply [login_get "/login?$loginAnon&fossil-goto=$loginGoTarget"]
511 test login-goto-anonymous-$loginGoName \
512 {[string match "*anonymous*" [reply_header $loginReply Set-Cookie]]
513 && [reply_header $loginReply Location] eq $loginGoWant} \
514 [trunk_mark $loginGoName {other-site host-prefix}]
515 set loginReply [login_get "/ityaar?$loginRobot&fossil-goto=$loginGoTarget"]
516 test_eq login-goto-ityaar-$loginGoName [reply_header $loginReply Location] \
517 $loginGoWant [trunk_mark $loginGoName {other-site host-prefix}]
518 }
519
520 # The captcha page at /honeypot remembers the address asked for in a
521 # "fossil-goto" cookie, and a right answer sent with that cookie goes there.
522 set loginReply [login_get /honeypot?x=1]
@@ -1326,11 +1323,11 @@
1326 base-more http://xy $loginHome \
1327 other http://y/ $loginHome \
1328 ] {
1329 test_eq login-goto-$loginFgName [reply_header [login_get \
1330 "/login?u=loginbob&p=bobfinal&fossil-goto=$loginFgTarget"] Location] \
1331 $loginFgWant [trunk_mark $loginFgName {base-more other}]
1332 }
1333
1334 # A GET with "out" does not log out.
1335 test login-logout-get {[string match \
1336 "*Currently logged in as <b>loginbob</b>*" \
@@ -1553,12 +1550,11 @@
1553 end-slash "[string repeat a 50]/" \
1554 ] {
1555 set loginReply [login_get "/ityaar?captchaseed=$loginSeed&captcha=zzzzzzzz" \
1556 [list "Cookie: $loginGrpCookie=$loginWfValue"]]
1557 test login-group-wellformed-$loginWfName \
1558 {[string match "*Prove that you are human*" $loginReply]} \
1559 [sanitizer_trunk_mark $loginWfName end-slash]
1560 }
1561 fossil login-group leave
1562
1563 # An empty login-group subcommand is unknown.
1564 fossil_raw login-group ""
1565
--- test/login.test
+++ test/login.test
@@ -17,11 +17,10 @@
17 }
18
19 require_no_open_checkout
20
21 test_setup
 
22
23 set loginRepo [file join [pwd] .rep.fossil]
24
25 # A user with Read, Write and Password capability, and a Setup user.
26 fossil user new loginbob [email protected] bobpw
@@ -469,12 +468,11 @@
468 } {
469 set loginReply [login_get /test-env \
470 [list "Cookie: $loginCookieName=$loginCkValue"]]
471 test login-cookie-bad-$loginCkName {$CODE == 0
472 && [reply_status $loginReply] eq "HTTP/1.0 200 OK"
473 && [login_who $loginReply] eq "nobody"}
 
474 }
475
476 ###############################################################################
477 # Where a login goes afterwards when the request carries "fossil-goto", as a
478 # query parameter, a form field or a cookie: to that address if it is on this
@@ -497,26 +495,25 @@
495 same-site http://x/timeline http://x/timeline \
496 ] {
497 set loginReply [login_get \
498 "/login?u=loginbob&p=newbobpw&fossil-goto=$loginGoTarget"]
499 test_eq login-goto-query-$loginGoName [reply_header $loginReply Location] \
500 $loginGoWant
501 set loginReply [login_form loginbob newbobpw "fossil-goto=$loginGoTarget"]
502 test_eq login-goto-form-$loginGoName [reply_header $loginReply Location] \
503 $loginGoWant
504 set loginReply [login_post /login "u=loginbob&p=newbobpw&in=Login" \
505 [list "Cookie: fossil-goto=$loginGoTarget"]]
506 test_eq login-goto-cookie-$loginGoName [reply_header $loginReply Location] \
507 $loginGoWant
508 set loginReply [login_get "/login?$loginAnon&fossil-goto=$loginGoTarget"]
509 test login-goto-anonymous-$loginGoName \
510 {[string match "*anonymous*" [reply_header $loginReply Set-Cookie]]
511 && [reply_header $loginReply Location] eq $loginGoWant}
 
512 set loginReply [login_get "/ityaar?$loginRobot&fossil-goto=$loginGoTarget"]
513 test_eq login-goto-ityaar-$loginGoName [reply_header $loginReply Location] \
514 $loginGoWant
515 }
516
517 # The captcha page at /honeypot remembers the address asked for in a
518 # "fossil-goto" cookie, and a right answer sent with that cookie goes there.
519 set loginReply [login_get /honeypot?x=1]
@@ -1326,11 +1323,11 @@
1323 base-more http://xy $loginHome \
1324 other http://y/ $loginHome \
1325 ] {
1326 test_eq login-goto-$loginFgName [reply_header [login_get \
1327 "/login?u=loginbob&p=bobfinal&fossil-goto=$loginFgTarget"] Location] \
1328 $loginFgWant
1329 }
1330
1331 # A GET with "out" does not log out.
1332 test login-logout-get {[string match \
1333 "*Currently logged in as <b>loginbob</b>*" \
@@ -1553,12 +1550,11 @@
1550 end-slash "[string repeat a 50]/" \
1551 ] {
1552 set loginReply [login_get "/ityaar?captchaseed=$loginSeed&captcha=zzzzzzzz" \
1553 [list "Cookie: $loginGrpCookie=$loginWfValue"]]
1554 test login-group-wellformed-$loginWfName \
1555 {[string match "*Prove that you are human*" $loginReply]}
 
1556 }
1557 fossil login-group leave
1558
1559 # An empty login-group subcommand is unknown.
1560 fossil_raw login-group ""
1561
+12 -20
--- test/name.test
+++ test/name.test
@@ -11,11 +11,10 @@
1111
# The first sections run at every level, and the rest need
1212
# -assurance stress.
1313
require_no_open_checkout
1414
1515
test_setup ""
16
-source [file join $::testfiledir trunk-fixes.tcl]
1716
1817
set nameRepo [file join [pwd] name.fossil]
1918
fossil new --admin-user alice --date-override "2025-01-01 00:00:00" $nameRepo
2019
fossil open $nameRepo
2120
fossil user default alice
@@ -469,13 +468,11 @@
469468
tag-not-date {trunk:2025} {} - \
470469
tag-colon-only {:} {} - \
471470
tag-two-colons {::} {} - \
472471
] {
473472
if {$nameWant eq "-"} { set nameWant $nameNoDate$nameName }
474
- test_eq name-date-$nameCase [name_id $nameName $nameType] $nameWant \
475
- [sanitizer_trunk_mark $nameCase \
476
- {compact-zulu-day compact-zulu-min compact-zulu-sec}]
473
+ test_eq name-date-$nameCase [name_id $nameName $nameType] $nameWant
477474
}
478475
479476
###############################################################################
480477
# Hashes and their beginnings, tags that look like hashes, record
481478
# numbers, and names with punctuation after them.
@@ -880,16 +877,15 @@
880877
}
881878
return [fossil_http $nameWeb [request_get $path] {*}$options]
882879
}
883880
884881
# Test NAME passes if the reply to a request for PATH holds every string
885
-# in WANTED and none of those that begin with "!". CONSTRAINTS is given
886
-# to the test.
882
+# in WANTED and none of those that begin with "!".
887883
#
888
-proc name_page {name path wanted {caps gjorz} {constraints ""}} {
884
+proc name_page {name path wanted {caps gjorz}} {
889885
set reply [name_get $path $caps]
890
- test_eq name-page-$name [name_missing $reply $wanted] {} $constraints
886
+ test_eq name-page-$name [name_missing $reply $wanted] {}
891887
}
892888
893889
set nameHref {<a href="/info/}
894890
895891
# A name that could mean more than one thing gets the page that lists
@@ -910,11 +906,11 @@
910906
$nameC3] admin
911907
name_page info-prefix /info/[string range $nameC1 0 9] [list \
912908
"!is ambiguous" "HTTP/1.0 200 OK" $nameC1] admin
913909
name_page info-date /info/date:2025-01-03 [list "HTTP/1.0 200 OK" $nameC2] admin
914910
name_page info-date-zulu /info/date:20250103Z [list "HTTP/1.0 200 OK" \
915
- $nameC2] admin [sanitizer_trunk_mark]
911
+ $nameC2] admin
916912
name_page info-escape /info/re%6c1 [list "HTTP/1.0 200 OK" $nameC1] admin
917913
name_page info-percent /info/% [list "No such object: %"]
918914
name_page info-bad-escape /info/%zz [list "No such object: "]
919915
name_page info-nul /info/rel1%00x [list "HTTP/1.0 200 OK" $nameC1] admin
920916
name_page info-long /info/[string repeat a 5000] [list "No such object: aaaa"]
@@ -980,12 +976,11 @@
980976
name_page timeline-number-after "/timeline?a=202501041000Z&n=2" [list \
981977
"occurring on or after 2025-01-04 10:00Z." b1 c3] admin
982978
name_page timeline-number-after-z "/timeline?a=20250104100000z&n=1" [list \
983979
"occurring on or after 2025-01-04 10:00:00Z." b1 "!>c3<"] admin
984980
name_page timeline-number-zulu-day "/timeline?a=20250104Z&n=1" [list \
985
- "HTTP/1.0 200 OK" "occurring on or after 20250104Z." b1 "!>c3<"] admin \
986
- [sanitizer_trunk_mark]
981
+ "HTTP/1.0 200 OK" "occurring on or after 20250104Z." b1 "!>c3<"] admin
987982
name_page timeline-number-is-hash /timeline?c=20250105 [list \
988983
"HTTP/1.0 200 OK" "!occurring around 2025-01-05"] admin
989984
name_page timeline-tag /timeline?c=rel1&n=1 [list \
990985
"occurring around rel1." c1] admin
991986
name_page timeline-technote "/timeline?c=[string range $nameEid 0 7]&n=1" \
@@ -1007,11 +1002,11 @@
10071002
"descendants of" ">br</a>"] admin
10081003
name_page timeline-forward-to-tag /timeline?d=rel1&ft=tag:br [list \
10091004
"HTTP/1.0 200 OK" "descendants of" ">tag:br</a>"] admin
10101005
name_page timeline-forward-to-hash \
10111006
"/timeline?d=rel1&ft=[string range $nameB1 0 9]" [list "HTTP/1.0 200 OK" \
1012
- "descendants of" ">[string range $nameB1 0 9]</a>"] admin $::trunkMark
1007
+ "descendants of" ">[string range $nameB1 0 9]</a>"] admin
10131008
name_page timeline-forward-to-none /timeline?d=rel1&ft=nosuch [list \
10141009
"HTTP/1.0 200 OK" "descendants of" "!cannot resolve"] admin
10151010
10161011
# A page that is given no name at all.
10171012
name_page forum-edit-no-name /forumedit [list \
@@ -1231,31 +1226,28 @@
12311226
"<tr><td>5<td>211<td>" "!collisions of length 4:" \
12321227
"<p>Collisions of length 4:\n<a href=\"/ambiguous/$nameCtwin\">"] admin
12331228
12341229
# A user with no capabilities is not shown the names of artifacts.
12351230
set nameReply [name_get /ambiguous/[string range $nameP 0 0] {}]
1236
-test name-page-ambiguous-no-read {![string match *$nameP* $nameReply]} \
1237
- $::trunkMark
1231
+test name-page-ambiguous-no-read {![string match *$nameP* $nameReply]}
12381232
12391233
###############################################################################
12401234
# Known faults.
12411235
12421236
# A request for more of the most recent artifacts than there are shows
12431237
# them all, and a request for fewer shows as many as asked for.
12441238
test name-page-bloblist-recent-all {[string match \
1245
- {*<tr><td align="right">1</td>*} [name_get /bloblist?recent&n=600 admin]]} \
1246
- $::trunkMark
1239
+ {*<tr><td align="right">1</td>*} [name_get /bloblist?recent&n=600 admin]]}
12471240
test name-page-bloblist-recent-count {[regexp -all {<tr><td align="right">} \
1248
- [name_get /bloblist?recent&n=250 admin]] == 250} $::trunkMark
1241
+ [name_get /bloblist?recent&n=250 admin]] == 250}
12491242
12501243
# The list of tags has a quoted key in JSON.
12511244
fossil whatis --json tip
1252
-test name-whatis-json-tags-key {[string match {*,"tags":\["br"\],*} $RESULT]} \
1253
- $::trunkMark
1245
+test name-whatis-json-tags-key {[string match {*,"tags":\["br"\],*} $RESULT]}
12541246
12551247
# The second meaning of a name is numbered 2 when it is a ticket.
12561248
fossil whatis [string range $nameC1 0 5]
12571249
test name-whatis-ticket-meaning-number \
1258
- {[string match "*---- meaning #2 ----*" $RESULT]} $::trunkMark
1250
+ {[string match "*---- meaning #2 ----*" $RESULT]}
12591251
12601252
###############################################################################
12611253
test_cleanup
12621254
--- test/name.test
+++ test/name.test
@@ -11,11 +11,10 @@
11 # The first sections run at every level, and the rest need
12 # -assurance stress.
13 require_no_open_checkout
14
15 test_setup ""
16 source [file join $::testfiledir trunk-fixes.tcl]
17
18 set nameRepo [file join [pwd] name.fossil]
19 fossil new --admin-user alice --date-override "2025-01-01 00:00:00" $nameRepo
20 fossil open $nameRepo
21 fossil user default alice
@@ -469,13 +468,11 @@
469 tag-not-date {trunk:2025} {} - \
470 tag-colon-only {:} {} - \
471 tag-two-colons {::} {} - \
472 ] {
473 if {$nameWant eq "-"} { set nameWant $nameNoDate$nameName }
474 test_eq name-date-$nameCase [name_id $nameName $nameType] $nameWant \
475 [sanitizer_trunk_mark $nameCase \
476 {compact-zulu-day compact-zulu-min compact-zulu-sec}]
477 }
478
479 ###############################################################################
480 # Hashes and their beginnings, tags that look like hashes, record
481 # numbers, and names with punctuation after them.
@@ -880,16 +877,15 @@
880 }
881 return [fossil_http $nameWeb [request_get $path] {*}$options]
882 }
883
884 # Test NAME passes if the reply to a request for PATH holds every string
885 # in WANTED and none of those that begin with "!". CONSTRAINTS is given
886 # to the test.
887 #
888 proc name_page {name path wanted {caps gjorz} {constraints ""}} {
889 set reply [name_get $path $caps]
890 test_eq name-page-$name [name_missing $reply $wanted] {} $constraints
891 }
892
893 set nameHref {<a href="/info/}
894
895 # A name that could mean more than one thing gets the page that lists
@@ -910,11 +906,11 @@
910 $nameC3] admin
911 name_page info-prefix /info/[string range $nameC1 0 9] [list \
912 "!is ambiguous" "HTTP/1.0 200 OK" $nameC1] admin
913 name_page info-date /info/date:2025-01-03 [list "HTTP/1.0 200 OK" $nameC2] admin
914 name_page info-date-zulu /info/date:20250103Z [list "HTTP/1.0 200 OK" \
915 $nameC2] admin [sanitizer_trunk_mark]
916 name_page info-escape /info/re%6c1 [list "HTTP/1.0 200 OK" $nameC1] admin
917 name_page info-percent /info/% [list "No such object: %"]
918 name_page info-bad-escape /info/%zz [list "No such object: "]
919 name_page info-nul /info/rel1%00x [list "HTTP/1.0 200 OK" $nameC1] admin
920 name_page info-long /info/[string repeat a 5000] [list "No such object: aaaa"]
@@ -980,12 +976,11 @@
980 name_page timeline-number-after "/timeline?a=202501041000Z&n=2" [list \
981 "occurring on or after 2025-01-04 10:00Z." b1 c3] admin
982 name_page timeline-number-after-z "/timeline?a=20250104100000z&n=1" [list \
983 "occurring on or after 2025-01-04 10:00:00Z." b1 "!>c3<"] admin
984 name_page timeline-number-zulu-day "/timeline?a=20250104Z&n=1" [list \
985 "HTTP/1.0 200 OK" "occurring on or after 20250104Z." b1 "!>c3<"] admin \
986 [sanitizer_trunk_mark]
987 name_page timeline-number-is-hash /timeline?c=20250105 [list \
988 "HTTP/1.0 200 OK" "!occurring around 2025-01-05"] admin
989 name_page timeline-tag /timeline?c=rel1&n=1 [list \
990 "occurring around rel1." c1] admin
991 name_page timeline-technote "/timeline?c=[string range $nameEid 0 7]&n=1" \
@@ -1007,11 +1002,11 @@
1007 "descendants of" ">br</a>"] admin
1008 name_page timeline-forward-to-tag /timeline?d=rel1&ft=tag:br [list \
1009 "HTTP/1.0 200 OK" "descendants of" ">tag:br</a>"] admin
1010 name_page timeline-forward-to-hash \
1011 "/timeline?d=rel1&ft=[string range $nameB1 0 9]" [list "HTTP/1.0 200 OK" \
1012 "descendants of" ">[string range $nameB1 0 9]</a>"] admin $::trunkMark
1013 name_page timeline-forward-to-none /timeline?d=rel1&ft=nosuch [list \
1014 "HTTP/1.0 200 OK" "descendants of" "!cannot resolve"] admin
1015
1016 # A page that is given no name at all.
1017 name_page forum-edit-no-name /forumedit [list \
@@ -1231,31 +1226,28 @@
1231 "<tr><td>5<td>211<td>" "!collisions of length 4:" \
1232 "<p>Collisions of length 4:\n<a href=\"/ambiguous/$nameCtwin\">"] admin
1233
1234 # A user with no capabilities is not shown the names of artifacts.
1235 set nameReply [name_get /ambiguous/[string range $nameP 0 0] {}]
1236 test name-page-ambiguous-no-read {![string match *$nameP* $nameReply]} \
1237 $::trunkMark
1238
1239 ###############################################################################
1240 # Known faults.
1241
1242 # A request for more of the most recent artifacts than there are shows
1243 # them all, and a request for fewer shows as many as asked for.
1244 test name-page-bloblist-recent-all {[string match \
1245 {*<tr><td align="right">1</td>*} [name_get /bloblist?recent&n=600 admin]]} \
1246 $::trunkMark
1247 test name-page-bloblist-recent-count {[regexp -all {<tr><td align="right">} \
1248 [name_get /bloblist?recent&n=250 admin]] == 250} $::trunkMark
1249
1250 # The list of tags has a quoted key in JSON.
1251 fossil whatis --json tip
1252 test name-whatis-json-tags-key {[string match {*,"tags":\["br"\],*} $RESULT]} \
1253 $::trunkMark
1254
1255 # The second meaning of a name is numbered 2 when it is a ticket.
1256 fossil whatis [string range $nameC1 0 5]
1257 test name-whatis-ticket-meaning-number \
1258 {[string match "*---- meaning #2 ----*" $RESULT]} $::trunkMark
1259
1260 ###############################################################################
1261 test_cleanup
1262
--- test/name.test
+++ test/name.test
@@ -11,11 +11,10 @@
11 # The first sections run at every level, and the rest need
12 # -assurance stress.
13 require_no_open_checkout
14
15 test_setup ""
 
16
17 set nameRepo [file join [pwd] name.fossil]
18 fossil new --admin-user alice --date-override "2025-01-01 00:00:00" $nameRepo
19 fossil open $nameRepo
20 fossil user default alice
@@ -469,13 +468,11 @@
468 tag-not-date {trunk:2025} {} - \
469 tag-colon-only {:} {} - \
470 tag-two-colons {::} {} - \
471 ] {
472 if {$nameWant eq "-"} { set nameWant $nameNoDate$nameName }
473 test_eq name-date-$nameCase [name_id $nameName $nameType] $nameWant
 
 
474 }
475
476 ###############################################################################
477 # Hashes and their beginnings, tags that look like hashes, record
478 # numbers, and names with punctuation after them.
@@ -880,16 +877,15 @@
877 }
878 return [fossil_http $nameWeb [request_get $path] {*}$options]
879 }
880
881 # Test NAME passes if the reply to a request for PATH holds every string
882 # in WANTED and none of those that begin with "!".
 
883 #
884 proc name_page {name path wanted {caps gjorz}} {
885 set reply [name_get $path $caps]
886 test_eq name-page-$name [name_missing $reply $wanted] {}
887 }
888
889 set nameHref {<a href="/info/}
890
891 # A name that could mean more than one thing gets the page that lists
@@ -910,11 +906,11 @@
906 $nameC3] admin
907 name_page info-prefix /info/[string range $nameC1 0 9] [list \
908 "!is ambiguous" "HTTP/1.0 200 OK" $nameC1] admin
909 name_page info-date /info/date:2025-01-03 [list "HTTP/1.0 200 OK" $nameC2] admin
910 name_page info-date-zulu /info/date:20250103Z [list "HTTP/1.0 200 OK" \
911 $nameC2] admin
912 name_page info-escape /info/re%6c1 [list "HTTP/1.0 200 OK" $nameC1] admin
913 name_page info-percent /info/% [list "No such object: %"]
914 name_page info-bad-escape /info/%zz [list "No such object: "]
915 name_page info-nul /info/rel1%00x [list "HTTP/1.0 200 OK" $nameC1] admin
916 name_page info-long /info/[string repeat a 5000] [list "No such object: aaaa"]
@@ -980,12 +976,11 @@
976 name_page timeline-number-after "/timeline?a=202501041000Z&n=2" [list \
977 "occurring on or after 2025-01-04 10:00Z." b1 c3] admin
978 name_page timeline-number-after-z "/timeline?a=20250104100000z&n=1" [list \
979 "occurring on or after 2025-01-04 10:00:00Z." b1 "!>c3<"] admin
980 name_page timeline-number-zulu-day "/timeline?a=20250104Z&n=1" [list \
981 "HTTP/1.0 200 OK" "occurring on or after 20250104Z." b1 "!>c3<"] admin
 
982 name_page timeline-number-is-hash /timeline?c=20250105 [list \
983 "HTTP/1.0 200 OK" "!occurring around 2025-01-05"] admin
984 name_page timeline-tag /timeline?c=rel1&n=1 [list \
985 "occurring around rel1." c1] admin
986 name_page timeline-technote "/timeline?c=[string range $nameEid 0 7]&n=1" \
@@ -1007,11 +1002,11 @@
1002 "descendants of" ">br</a>"] admin
1003 name_page timeline-forward-to-tag /timeline?d=rel1&ft=tag:br [list \
1004 "HTTP/1.0 200 OK" "descendants of" ">tag:br</a>"] admin
1005 name_page timeline-forward-to-hash \
1006 "/timeline?d=rel1&ft=[string range $nameB1 0 9]" [list "HTTP/1.0 200 OK" \
1007 "descendants of" ">[string range $nameB1 0 9]</a>"] admin
1008 name_page timeline-forward-to-none /timeline?d=rel1&ft=nosuch [list \
1009 "HTTP/1.0 200 OK" "descendants of" "!cannot resolve"] admin
1010
1011 # A page that is given no name at all.
1012 name_page forum-edit-no-name /forumedit [list \
@@ -1231,31 +1226,28 @@
1226 "<tr><td>5<td>211<td>" "!collisions of length 4:" \
1227 "<p>Collisions of length 4:\n<a href=\"/ambiguous/$nameCtwin\">"] admin
1228
1229 # A user with no capabilities is not shown the names of artifacts.
1230 set nameReply [name_get /ambiguous/[string range $nameP 0 0] {}]
1231 test name-page-ambiguous-no-read {![string match *$nameP* $nameReply]}
 
1232
1233 ###############################################################################
1234 # Known faults.
1235
1236 # A request for more of the most recent artifacts than there are shows
1237 # them all, and a request for fewer shows as many as asked for.
1238 test name-page-bloblist-recent-all {[string match \
1239 {*<tr><td align="right">1</td>*} [name_get /bloblist?recent&n=600 admin]]}
 
1240 test name-page-bloblist-recent-count {[regexp -all {<tr><td align="right">} \
1241 [name_get /bloblist?recent&n=250 admin]] == 250}
1242
1243 # The list of tags has a quoted key in JSON.
1244 fossil whatis --json tip
1245 test name-whatis-json-tags-key {[string match {*,"tags":\["br"\],*} $RESULT]}
 
1246
1247 # The second meaning of a name is numbered 2 when it is a ticket.
1248 fossil whatis [string range $nameC1 0 5]
1249 test name-whatis-ticket-meaning-number \
1250 {[string match "*---- meaning #2 ----*" $RESULT]}
1251
1252 ###############################################################################
1253 test_cleanup
1254
+1 -3
--- test/purge.test
+++ test/purge.test
@@ -8,11 +8,10 @@
88
# The first sections run at every level, and the rest need
99
# -assurance stress.
1010
require_no_open_checkout
1111
1212
test_setup
13
-source [file join $::testfiledir trunk-fixes.tcl]
1413
1514
proc purge_sql {sql {repo .rep.fossil}} {
1615
return [fossil_sql $sql $repo]
1716
}
1817
@@ -427,12 +426,11 @@
427426
file copy -force p8.fossil damaged.fossil
428427
fossil sql -R damaged.fossil $purgeDamage
429428
set purgeBefore [repository_state damaged.fossil]
430429
fossil_raw purge {*}$purgeArgs -R damaged.fossil
431430
test purge-damage-$purgeName {$CODE == 1 &&
432
- [string match $purgeMessage $RESULT]} \
433
- [trunk_mark $purgeName cat-source-loop]
431
+ [string match $purgeMessage $RESULT]}
434432
test_eq purge-damage-$purgeName-no-change [repository_state damaged.fossil] \
435433
$purgeBefore
436434
test_eq purge-damage-$purgeName-event-kept \
437435
[purge_last_event damaged.fossil] $purgeEvent8
438436
}
439437
--- test/purge.test
+++ test/purge.test
@@ -8,11 +8,10 @@
8 # The first sections run at every level, and the rest need
9 # -assurance stress.
10 require_no_open_checkout
11
12 test_setup
13 source [file join $::testfiledir trunk-fixes.tcl]
14
15 proc purge_sql {sql {repo .rep.fossil}} {
16 return [fossil_sql $sql $repo]
17 }
18
@@ -427,12 +426,11 @@
427 file copy -force p8.fossil damaged.fossil
428 fossil sql -R damaged.fossil $purgeDamage
429 set purgeBefore [repository_state damaged.fossil]
430 fossil_raw purge {*}$purgeArgs -R damaged.fossil
431 test purge-damage-$purgeName {$CODE == 1 &&
432 [string match $purgeMessage $RESULT]} \
433 [trunk_mark $purgeName cat-source-loop]
434 test_eq purge-damage-$purgeName-no-change [repository_state damaged.fossil] \
435 $purgeBefore
436 test_eq purge-damage-$purgeName-event-kept \
437 [purge_last_event damaged.fossil] $purgeEvent8
438 }
439
--- test/purge.test
+++ test/purge.test
@@ -8,11 +8,10 @@
8 # The first sections run at every level, and the rest need
9 # -assurance stress.
10 require_no_open_checkout
11
12 test_setup
 
13
14 proc purge_sql {sql {repo .rep.fossil}} {
15 return [fossil_sql $sql $repo]
16 }
17
@@ -427,12 +426,11 @@
426 file copy -force p8.fossil damaged.fossil
427 fossil sql -R damaged.fossil $purgeDamage
428 set purgeBefore [repository_state damaged.fossil]
429 fossil_raw purge {*}$purgeArgs -R damaged.fossil
430 test purge-damage-$purgeName {$CODE == 1 &&
431 [string match $purgeMessage $RESULT]}
 
432 test_eq purge-damage-$purgeName-no-change [repository_state damaged.fossil] \
433 $purgeBefore
434 test_eq purge-damage-$purgeName-event-kept \
435 [purge_last_event damaged.fossil] $purgeEvent8
436 }
437
--- test/rebuild.test
+++ test/rebuild.test
@@ -10,11 +10,10 @@
1010
# The first sections run at every level, and the rest need
1111
# -assurance stress.
1212
require_no_open_checkout
1313
1414
test_setup
15
-source [file join $::testfiledir trunk-fixes.tcl]
1615
1716
proc rebuild_sql {sql {repo .rep.fossil}} {
1817
return [fossil_sql $sql $repo]
1918
}
2019
@@ -418,13 +417,13 @@
418417
test rebuild-index-search {[string match "*rebuild-side-1*" $RESULT]}
419418
# --compress-only with --index, when there is an index already, builds it
420419
# again.
421420
fossil sql -R fts.fossil "DELETE FROM ftsdocs"
422421
fossil rebuild fts.fossil --compress-only --index
423
-test rebuild-index-compress-only-index {$CODE == 0} $::trunkMark
422
+test rebuild-index-compress-only-index {$CODE == 0}
424423
test_eq rebuild-index-compress-only-index-filled \
425
- [rebuild_indexed fts.fossil] $rebuildDocs $::trunkMark
424
+ [rebuild_indexed fts.fossil] $rebuildDocs
426425
fossil rebuild fts.fossil --noindex
427426
test rebuild-noindex {$CODE == 0}
428427
test_eq rebuild-noindex-gone [rebuild_indexed fts.fossil] none
429428
test_eq rebuild-index-state \
430429
[repository_state_diff $rebuildStart [repository_state fts.fossil]] ""
@@ -582,14 +581,11 @@
582581
WHERE rid=1" r-keep.fossil] $rebuildFirst
583582
test_eq rebuild-reconstruct-keep-private \
584583
[rebuild_hashes r-keep.fossil "rid IN private"] $rebuildPrivate
585584
test_eq rebuild-reconstruct-keep-state \
586585
[repository_state_diff $rebuildStart [repository_state r-keep.fossil]] ""
587
-fossil test-integrity -R r-keep.fossil
588
-test rebuild-reconstruct-keep-integrity {$CODE == 0} $::trunkMark
589
-fossil test-missing -R r-keep.fossil
590
-test rebuild-reconstruct-keep-missing {$CODE == 0}
586
+repository_sound rebuild-reconstruct-keep r-keep.fossil
591587
592588
# Without -P every artifact in the directory becomes public.
593589
fossil reconstruct r-private.fossil d-private
594590
test rebuild-reconstruct-private {$CODE == 0}
595591
test_eq rebuild-reconstruct-private-all [rebuild_hashes r-private.fossil] \
@@ -639,13 +635,13 @@
639635
640636
# A destination that is a file is refused, and the file is kept.
641637
write_file d-file.txt "a file, not a directory\n"
642638
fossil deconstruct -R full.fossil d-file.txt -expectError
643639
test rebuild-deconstruct-file-destination {$CODE != 0 &&
644
- [string match "*is not a directory*" $RESULT]} $::trunkMark
640
+ [string match "*is not a directory*" $RESULT]}
645641
test rebuild-deconstruct-file-destination-kept \
646
- {[file isfile d-file.txt]} $::trunkMark
642
+ {[file isfile d-file.txt]}
647643
648644
# A destination that cannot be written to, where the system can make one.
649645
catch {file attributes d-none -permissions 0555}
650646
if {![file writable d-none]} {
651647
fossil deconstruct -R full.fossil d-none -expectError
652648
--- test/rebuild.test
+++ test/rebuild.test
@@ -10,11 +10,10 @@
10 # The first sections run at every level, and the rest need
11 # -assurance stress.
12 require_no_open_checkout
13
14 test_setup
15 source [file join $::testfiledir trunk-fixes.tcl]
16
17 proc rebuild_sql {sql {repo .rep.fossil}} {
18 return [fossil_sql $sql $repo]
19 }
20
@@ -418,13 +417,13 @@
418 test rebuild-index-search {[string match "*rebuild-side-1*" $RESULT]}
419 # --compress-only with --index, when there is an index already, builds it
420 # again.
421 fossil sql -R fts.fossil "DELETE FROM ftsdocs"
422 fossil rebuild fts.fossil --compress-only --index
423 test rebuild-index-compress-only-index {$CODE == 0} $::trunkMark
424 test_eq rebuild-index-compress-only-index-filled \
425 [rebuild_indexed fts.fossil] $rebuildDocs $::trunkMark
426 fossil rebuild fts.fossil --noindex
427 test rebuild-noindex {$CODE == 0}
428 test_eq rebuild-noindex-gone [rebuild_indexed fts.fossil] none
429 test_eq rebuild-index-state \
430 [repository_state_diff $rebuildStart [repository_state fts.fossil]] ""
@@ -582,14 +581,11 @@
582 WHERE rid=1" r-keep.fossil] $rebuildFirst
583 test_eq rebuild-reconstruct-keep-private \
584 [rebuild_hashes r-keep.fossil "rid IN private"] $rebuildPrivate
585 test_eq rebuild-reconstruct-keep-state \
586 [repository_state_diff $rebuildStart [repository_state r-keep.fossil]] ""
587 fossil test-integrity -R r-keep.fossil
588 test rebuild-reconstruct-keep-integrity {$CODE == 0} $::trunkMark
589 fossil test-missing -R r-keep.fossil
590 test rebuild-reconstruct-keep-missing {$CODE == 0}
591
592 # Without -P every artifact in the directory becomes public.
593 fossil reconstruct r-private.fossil d-private
594 test rebuild-reconstruct-private {$CODE == 0}
595 test_eq rebuild-reconstruct-private-all [rebuild_hashes r-private.fossil] \
@@ -639,13 +635,13 @@
639
640 # A destination that is a file is refused, and the file is kept.
641 write_file d-file.txt "a file, not a directory\n"
642 fossil deconstruct -R full.fossil d-file.txt -expectError
643 test rebuild-deconstruct-file-destination {$CODE != 0 &&
644 [string match "*is not a directory*" $RESULT]} $::trunkMark
645 test rebuild-deconstruct-file-destination-kept \
646 {[file isfile d-file.txt]} $::trunkMark
647
648 # A destination that cannot be written to, where the system can make one.
649 catch {file attributes d-none -permissions 0555}
650 if {![file writable d-none]} {
651 fossil deconstruct -R full.fossil d-none -expectError
652
--- test/rebuild.test
+++ test/rebuild.test
@@ -10,11 +10,10 @@
10 # The first sections run at every level, and the rest need
11 # -assurance stress.
12 require_no_open_checkout
13
14 test_setup
 
15
16 proc rebuild_sql {sql {repo .rep.fossil}} {
17 return [fossil_sql $sql $repo]
18 }
19
@@ -418,13 +417,13 @@
417 test rebuild-index-search {[string match "*rebuild-side-1*" $RESULT]}
418 # --compress-only with --index, when there is an index already, builds it
419 # again.
420 fossil sql -R fts.fossil "DELETE FROM ftsdocs"
421 fossil rebuild fts.fossil --compress-only --index
422 test rebuild-index-compress-only-index {$CODE == 0}
423 test_eq rebuild-index-compress-only-index-filled \
424 [rebuild_indexed fts.fossil] $rebuildDocs
425 fossil rebuild fts.fossil --noindex
426 test rebuild-noindex {$CODE == 0}
427 test_eq rebuild-noindex-gone [rebuild_indexed fts.fossil] none
428 test_eq rebuild-index-state \
429 [repository_state_diff $rebuildStart [repository_state fts.fossil]] ""
@@ -582,14 +581,11 @@
581 WHERE rid=1" r-keep.fossil] $rebuildFirst
582 test_eq rebuild-reconstruct-keep-private \
583 [rebuild_hashes r-keep.fossil "rid IN private"] $rebuildPrivate
584 test_eq rebuild-reconstruct-keep-state \
585 [repository_state_diff $rebuildStart [repository_state r-keep.fossil]] ""
586 repository_sound rebuild-reconstruct-keep r-keep.fossil
 
 
 
587
588 # Without -P every artifact in the directory becomes public.
589 fossil reconstruct r-private.fossil d-private
590 test rebuild-reconstruct-private {$CODE == 0}
591 test_eq rebuild-reconstruct-private-all [rebuild_hashes r-private.fossil] \
@@ -639,13 +635,13 @@
635
636 # A destination that is a file is refused, and the file is kept.
637 write_file d-file.txt "a file, not a directory\n"
638 fossil deconstruct -R full.fossil d-file.txt -expectError
639 test rebuild-deconstruct-file-destination {$CODE != 0 &&
640 [string match "*is not a directory*" $RESULT]}
641 test rebuild-deconstruct-file-destination-kept \
642 {[file isfile d-file.txt]}
643
644 # A destination that cannot be written to, where the system can make one.
645 catch {file attributes d-none -permissions 0555}
646 if {![file writable d-none]} {
647 fossil deconstruct -R full.fossil d-none -expectError
648
--- test/regress.test
+++ test/regress.test
@@ -3,11 +3,10 @@
33
#
44
55
require_no_open_checkout
66
77
test_setup
8
-source [file join $::testfiledir trunk-fixes.tcl]
98
109
write_file a.txt "a\n"
1110
fossil add a.txt
1211
fossil commit -m "regress-c1"
1312
@@ -198,11 +197,11 @@
198197
###############################################################################
199198
# A port number above 65535 in a URL is refused with an error.
200199
201200
fossil remote http://example.invalid:99999999999/x -expectError
202201
test regress-url-port-too-large {$CODE != 0
203
- && [string match "*port number too large*" $RESULT]} $::trunkMark
202
+ && [string match "*port number too large*" $RESULT]}
204203
fossil remote http://example.invalid:65535/x
205204
test regress-url-port-largest {$CODE == 0}
206205
fossil remote off
207206
208207
###############################################################################
@@ -241,11 +240,11 @@
241240
fossil wiki create AttachPage wiki.txt
242241
fossil attachment add AttachPage attach.txt
243242
fossil clone .rep.fossil regress-attach-clone.fossil
244243
fossil push regress-attach-clone.fossil --once
245244
test regress-push-held-attachment {$CODE == 0
246
- && ![string match "*UNIQUE constraint*" $RESULT]} $::trunkMark
245
+ && ![string match "*UNIQUE constraint*" $RESULT]}
247246
fossil sql -R regress-attach-clone.fossil \
248247
"SELECT count(*) FROM attachment WHERE target='AttachPage'"
249248
test_eq regress-push-held-attachment-rows [string trim $RESULT] 1
250249
251250
###############################################################################
@@ -254,12 +253,11 @@
254253
255254
foreach {regressName regressRobot} {unset {} list timelineX,diff all *} {
256255
fossil settings robot-restrict $regressRobot
257256
fossil_raw test-th-eval --open-config {styleHeader {Page Title}}
258257
test regress-styleheader-cli-$regressName \
259
- {$CODE == 0 && [string match "*<title>*: Page Title</title>*" $RESULT]} \
260
- $::trunkMark
258
+ {$CODE == 0 && [string match "*<title>*: Page Title</title>*" $RESULT]}
261259
}
262260
fossil settings robot-restrict ""
263261
264262
###############################################################################
265263
# A base URL given with --baseurl and no path, with or without a slash after
@@ -268,10 +266,9 @@
268266
269267
write_file baseurl-req.txt "GET /robots.txt HTTP/1.1\r\nHost: x\r\n\r\n"
270268
foreach {regressName regressUrl} {bare https://x slash https://x/} {
271269
fossil_raw http .rep.fossil --in baseurl-req.txt --baseurl $regressUrl
272270
test regress-baseurl-no-path-$regressName \
273
- {$CODE == 0 && [string match "HTTP/1.0 200*" $RESULT]} \
274
- [sanitizer_trunk_mark $regressName {bare slash}]
271
+ {$CODE == 0 && [string match "HTTP/1.0 200*" $RESULT]}
275272
}
276273
277274
test_cleanup
278275
--- test/regress.test
+++ test/regress.test
@@ -3,11 +3,10 @@
3 #
4
5 require_no_open_checkout
6
7 test_setup
8 source [file join $::testfiledir trunk-fixes.tcl]
9
10 write_file a.txt "a\n"
11 fossil add a.txt
12 fossil commit -m "regress-c1"
13
@@ -198,11 +197,11 @@
198 ###############################################################################
199 # A port number above 65535 in a URL is refused with an error.
200
201 fossil remote http://example.invalid:99999999999/x -expectError
202 test regress-url-port-too-large {$CODE != 0
203 && [string match "*port number too large*" $RESULT]} $::trunkMark
204 fossil remote http://example.invalid:65535/x
205 test regress-url-port-largest {$CODE == 0}
206 fossil remote off
207
208 ###############################################################################
@@ -241,11 +240,11 @@
241 fossil wiki create AttachPage wiki.txt
242 fossil attachment add AttachPage attach.txt
243 fossil clone .rep.fossil regress-attach-clone.fossil
244 fossil push regress-attach-clone.fossil --once
245 test regress-push-held-attachment {$CODE == 0
246 && ![string match "*UNIQUE constraint*" $RESULT]} $::trunkMark
247 fossil sql -R regress-attach-clone.fossil \
248 "SELECT count(*) FROM attachment WHERE target='AttachPage'"
249 test_eq regress-push-held-attachment-rows [string trim $RESULT] 1
250
251 ###############################################################################
@@ -254,12 +253,11 @@
254
255 foreach {regressName regressRobot} {unset {} list timelineX,diff all *} {
256 fossil settings robot-restrict $regressRobot
257 fossil_raw test-th-eval --open-config {styleHeader {Page Title}}
258 test regress-styleheader-cli-$regressName \
259 {$CODE == 0 && [string match "*<title>*: Page Title</title>*" $RESULT]} \
260 $::trunkMark
261 }
262 fossil settings robot-restrict ""
263
264 ###############################################################################
265 # A base URL given with --baseurl and no path, with or without a slash after
@@ -268,10 +266,9 @@
268
269 write_file baseurl-req.txt "GET /robots.txt HTTP/1.1\r\nHost: x\r\n\r\n"
270 foreach {regressName regressUrl} {bare https://x slash https://x/} {
271 fossil_raw http .rep.fossil --in baseurl-req.txt --baseurl $regressUrl
272 test regress-baseurl-no-path-$regressName \
273 {$CODE == 0 && [string match "HTTP/1.0 200*" $RESULT]} \
274 [sanitizer_trunk_mark $regressName {bare slash}]
275 }
276
277 test_cleanup
278
--- test/regress.test
+++ test/regress.test
@@ -3,11 +3,10 @@
3 #
4
5 require_no_open_checkout
6
7 test_setup
 
8
9 write_file a.txt "a\n"
10 fossil add a.txt
11 fossil commit -m "regress-c1"
12
@@ -198,11 +197,11 @@
197 ###############################################################################
198 # A port number above 65535 in a URL is refused with an error.
199
200 fossil remote http://example.invalid:99999999999/x -expectError
201 test regress-url-port-too-large {$CODE != 0
202 && [string match "*port number too large*" $RESULT]}
203 fossil remote http://example.invalid:65535/x
204 test regress-url-port-largest {$CODE == 0}
205 fossil remote off
206
207 ###############################################################################
@@ -241,11 +240,11 @@
240 fossil wiki create AttachPage wiki.txt
241 fossil attachment add AttachPage attach.txt
242 fossil clone .rep.fossil regress-attach-clone.fossil
243 fossil push regress-attach-clone.fossil --once
244 test regress-push-held-attachment {$CODE == 0
245 && ![string match "*UNIQUE constraint*" $RESULT]}
246 fossil sql -R regress-attach-clone.fossil \
247 "SELECT count(*) FROM attachment WHERE target='AttachPage'"
248 test_eq regress-push-held-attachment-rows [string trim $RESULT] 1
249
250 ###############################################################################
@@ -254,12 +253,11 @@
253
254 foreach {regressName regressRobot} {unset {} list timelineX,diff all *} {
255 fossil settings robot-restrict $regressRobot
256 fossil_raw test-th-eval --open-config {styleHeader {Page Title}}
257 test regress-styleheader-cli-$regressName \
258 {$CODE == 0 && [string match "*<title>*: Page Title</title>*" $RESULT]}
 
259 }
260 fossil settings robot-restrict ""
261
262 ###############################################################################
263 # A base URL given with --baseurl and no path, with or without a slash after
@@ -268,10 +266,9 @@
266
267 write_file baseurl-req.txt "GET /robots.txt HTTP/1.1\r\nHost: x\r\n\r\n"
268 foreach {regressName regressUrl} {bare https://x slash https://x/} {
269 fossil_raw http .rep.fossil --in baseurl-req.txt --baseurl $regressUrl
270 test regress-baseurl-no-path-$regressName \
271 {$CODE == 0 && [string match "HTTP/1.0 200*" $RESULT]}
 
272 }
273
274 test_cleanup
275
--- test/ssh.test
+++ test/ssh.test
@@ -17,11 +17,10 @@
1717
if {$::tcl_platform(platform) eq "windows"} {
1818
test_skip "the stand-in for ssh is a shell script"
1919
}
2020
2121
test_setup
22
-source [file join $::testfiledir trunk-fixes.tcl]
2322
2423
set sshDir [file join [pwd] ssh-standin]
2524
file mkdir $sshDir
2625
set sshStub [test_standin log-args.sh [file join $sshDir ssh]]
2726
set sshLog [file join [pwd] ssh-args.txt]
2827
--- test/ssh.test
+++ test/ssh.test
@@ -17,11 +17,10 @@
17 if {$::tcl_platform(platform) eq "windows"} {
18 test_skip "the stand-in for ssh is a shell script"
19 }
20
21 test_setup
22 source [file join $::testfiledir trunk-fixes.tcl]
23
24 set sshDir [file join [pwd] ssh-standin]
25 file mkdir $sshDir
26 set sshStub [test_standin log-args.sh [file join $sshDir ssh]]
27 set sshLog [file join [pwd] ssh-args.txt]
28
--- test/ssh.test
+++ test/ssh.test
@@ -17,11 +17,10 @@
17 if {$::tcl_platform(platform) eq "windows"} {
18 test_skip "the stand-in for ssh is a shell script"
19 }
20
21 test_setup
 
22
23 set sshDir [file join [pwd] ssh-standin]
24 file mkdir $sshDir
25 set sshStub [test_standin log-args.sh [file join $sshDir ssh]]
26 set sshLog [file join [pwd] ssh-args.txt]
27
+19 -26
--- test/th1main.test
+++ test/th1main.test
@@ -6,11 +6,10 @@
66
#
77
88
# The first sections run at every level, and the rest need
99
# -assurance stress.
1010
test_setup
11
-source [file join $::testfiledir trunk-fixes.tcl]
1211
1312
write_file a.txt "hello\n"
1413
write_file f83.txt "line 83\n"
1514
write_file f100.txt "line 100\n"
1615
fossil add a.txt f83.txt f100.txt
@@ -43,16 +42,15 @@
4342
}
4443
}
4544
4645
# Run each row of TABLE: a test name, options for test-th-eval, a
4746
# script, a mode and an expected value as th1main_check takes them.
48
-# CONSTRAINTS is given to every test of the table.
4947
#
50
-proc th1main_table {table {constraints ""}} {
48
+proc th1main_table {table} {
5149
foreach {name opts script mode expected} $table {
5250
set got [th1main_eval $script {*}$opts]
53
- th1main_check th1main-$name $got $mode $expected $constraints
51
+ th1main_check th1main-$name $got $mode $expected
5452
}
5553
}
5654
5755
###############################################################################
5856
# Every command refuses a call with too few or too many arguments. Each
@@ -167,12 +165,11 @@
167165
{http ?-asynchronous? ?--? url ?payload?}
168166
capture-few {captureTh1} {captureTh1 STRING}
169167
capture-many {captureTh1 a b} {captureTh1 STRING}
170168
} {
171169
test_eq th1main-args-$th1mainName [th1main_eval $th1mainCall] \
172
- "TH_ERROR: wrong # args: should be \"$th1mainUsage\"" \
173
- [trunk_mark $th1mainName {randhex-many http-none http-three}]
170
+ "TH_ERROR: wrong # args: should be \"$th1mainUsage\""
174171
}
175172
176173
if {[test_assurance] ne "stress"} {
177174
test_skip "the tests after the first sections need -assurance stress"
178175
}
@@ -523,14 +520,14 @@
523520
# Unversioned files.
524521
525522
# In a repository that has never held an unversioned file, "unversioned
526523
# list" gives an empty list and "unversioned content" a script error.
527524
set th1mainGot [th1main_eval {unversioned list}]
528
-test th1main-uv-list-none {$CODE == 0 && $th1mainGot eq ""} $::trunkMark
525
+test th1main-uv-list-none {$CODE == 0 && $th1mainGot eq ""}
529526
set th1mainGot [th1main_eval {unversioned content nosuch}]
530527
test th1main-uv-content-none \
531
- {$CODE == 0 && [string match "TH_ERROR:*" $th1mainGot]} $::trunkMark
528
+ {$CODE == 0 && [string match "TH_ERROR:*" $th1mainGot]}
532529
533530
write_file u.txt "data\n"
534531
write_file v.txt "more\n"
535532
fossil uv add u.txt v.txt
536533
fossil uv rm v.txt
@@ -556,14 +553,14 @@
556553
fossil sql "SELECT substr(uuid,1,4) FROM blob GROUP BY 1 HAVING count(*)>1"
557554
set th1mainPrefix [string trim $RESULT]
558555
test_eq th1main-ambiguous-setup $th1mainPrefix 2b06
559556
set th1mainGot [th1main_eval "artifact $th1mainPrefix"]
560557
test th1main-artifact-ambiguous \
561
- {$CODE == 0 && $th1mainGot eq "TH_ERROR: ambiguous name"} $::trunkMark
558
+ {$CODE == 0 && $th1mainGot eq "TH_ERROR: ambiguous name"}
562559
set th1mainGot [th1main_eval "artifact $th1mainPrefix a.txt"]
563560
test th1main-artifact-ambiguous-checkin \
564
- {$CODE == 0 && [string match "TH_ERROR: *" $th1mainGot]} $::trunkMark
561
+ {$CODE == 0 && [string match "TH_ERROR: *" $th1mainGot]}
565562
test_eq th1main-dir-ambiguous [th1main_eval "dir $th1mainPrefix"] {}
566563
567564
# "setting -strict" and "http -asynchronous" with nothing after the
568565
# option, and "http" with an empty first argument, give a script error.
569566
foreach {th1mainName th1mainCall th1mainUsage} {
@@ -572,17 +569,17 @@
572569
{http ?-asynchronous? ?--? url ?payload?}
573570
http-empty {http {}} {http ?-asynchronous? ?--? url ?payload?}
574571
} {
575572
set th1mainGot [th1main_eval $th1mainCall]
576573
test th1main-args-$th1mainName {$CODE == 0 && [string match \
577
- "TH_ERROR: *" $th1mainGot]} $::trunkMark
574
+ "TH_ERROR: *" $th1mainGot]}
578575
}
579576
580577
# combobox with a second argument that is not a list gives a script error.
581578
set th1mainGot [th1main_eval "combobox nm \"\{\" 1"]
582579
test th1main-combobox-not-list \
583
- {$CODE == 0 && [string match "*TH_ERROR: *" $th1mainGot]} $::trunkMark
580
+ {$CODE == 0 && [string match "*TH_ERROR: *" $th1mainGot]}
584581
585582
# A query runs each of its statements once.
586583
foreach {th1mainName th1mainSql} {
587584
two {SELECT 1 AS a; SELECT 2 AS a}
588585
space {SELECT 1 AS a; }
@@ -591,30 +588,27 @@
591588
[join [list \
592589
"set n 0; query {$th1mainSql} {set n \[expr {\$n+1}\]; if " \
593590
"{\$n>50} {error endless}}; set n"] ""]
594591
test th1main-query-statements-$th1mainName \
595592
{$CODE == 0 && [string trim $RESULT] eq [dict get {two 2 space 1} \
596
- $th1mainName]} $::trunkMark
593
+ $th1mainName]}
597594
}
598595
599596
# builtin_request_js with a name that is not a built-in file gives a
600597
# script error.
601598
set th1mainGot [th1main_eval {builtin_request_js nosuch.js}]
602
-test th1main-requestjs-unknown {$CODE == 0} $::trunkMark
599
+test th1main-requestjs-unknown {$CODE == 0}
603600
604601
# randhex gives at most 50 bytes, 100 digits.
605
-test_match th1main-randhex-50 [th1main_eval {randhex 50}] {^[0-9a-f]{100}$} \
606
- [sanitizer_trunk_mark]
607
-test th1main-randhex-50-exit {$CODE == 0} [sanitizer_trunk_mark]
608
-test_match th1main-randhex-over [th1main_eval {randhex 1000}] \
609
- {^[0-9a-f]{100}$} \
610
- [sanitizer_trunk_mark]
602
+test_match th1main-randhex-50 [th1main_eval {randhex 50}] {^[0-9a-f]{100}$}
603
+test th1main-randhex-50-exit {$CODE == 0}
604
+test_match th1main-randhex-over [th1main_eval {randhex 1000}] {^[0-9a-f]{100}$}
611605
612606
# http with text that is not a URL gives a script error.
613607
set th1mainGot [th1main_eval {http not-a-url}]
614608
test th1main-http-not-url \
615
- {$CODE == 0 && [string match "TH_ERROR: *" $th1mainGot]} $::trunkMark
609
+ {$CODE == 0 && [string match "TH_ERROR: *" $th1mainGot]}
616610
617611
# A phantom: an artifact whose content the repository does not hold.
618612
set th1mainPhantom \
619613
abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789
620614
fossil sql "INSERT INTO blob(rcvid,size,uuid) VALUES(0,-1,'$th1mainPhantom');
@@ -743,11 +737,11 @@
743737
{maybe_set default_csp } {set project_name [taint }}
744738
} {
745739
set th1mainGot [th1main_eval $th1mainScript --th-trace {*}$th1mainOpts]
746740
test th1main-trace-$th1mainName {[holds_strings $th1mainGot [concat \
747741
{{------------------ BEGIN TRACE LOG ------------------}} \
748
- $th1mainWanted]]} [trunk_mark $th1mainName header]
742
+ $th1mainWanted]]}
749743
}
750744
751745
###############################################################################
752746
# Templates: text with TH1 between <th1> and </th1>, $name for the value
753747
# of a variable as it is and $<name> for its value escaped for HTML.
@@ -809,12 +803,11 @@
809803
foreach {th1mainName th1mainText} {
810804
break {a<th1>break</th1>after}
811805
continue {a<th1>continue</th1>after}
812806
return {a<th1>return 5</th1>after}
813807
} {
814
- test_eq th1main-render-$th1mainName [th1main_render $th1mainText] a \
815
- $::trunkMark
808
+ test_eq th1main-render-$th1mainName [th1main_render $th1mainText] a
816809
}
817810
818811
# Text after a zero byte in the file is not rendered.
819812
test_eq th1main-render-zero-byte [th1main_render "a\0b<th1>puts c</th1>"] a
820813
@@ -1016,20 +1009,20 @@
10161009
th1main_table {
10171010
redirect-no-request {} {redirect /elsewhere}
10181011
eq {TH_ERROR: redirect is only allowed in a web request }
10191012
redirect-no-request-http {} {redirect http://example.com/}
10201013
eq {TH_ERROR: redirect is only allowed in a web request }
1021
-} $::trunkMark
1014
+}
10221015
set th1mainGot [th1main_eval {redirect http://example.com/a} --cgi]
10231016
test th1main-redirect-cgi-http {[holds_strings $th1mainGot [list \
10241017
"Status: 302 " "Location: http://example.com/a\r\n"]]}
10251018
set th1mainGot [th1main_eval {redirect https://example.com/a} --cgi]
10261019
test th1main-redirect-cgi-https {[holds_strings $th1mainGot [list \
10271020
"Status: 302 " "Location: https://example.com/a\r\n"]]}
10281021
set th1mainGot [th1main_eval {redirect /relative} --cgi]
10291022
test th1main-redirect-cgi-relative {[holds_strings $th1mainGot \
1030
- {{redirect is only allowed in a web request} !Location}]} $::trunkMark
1023
+ {{redirect is only allowed in a web request} !Location}]}
10311024
10321025
# verifyCsrf lets through only a POST from the same site that carries
10331026
# the token insertCsrf wrote.
10341027
set th1mainGot [th1main_page {<th1>insertCsrf</th1>}]
10351028
regexp {name="csrf" value="([^"]+)"} $th1mainGot -> th1mainToken
10361029
10371030
DELETED test/trunk-fixes.tcl
--- test/th1main.test
+++ test/th1main.test
@@ -6,11 +6,10 @@
6 #
7
8 # The first sections run at every level, and the rest need
9 # -assurance stress.
10 test_setup
11 source [file join $::testfiledir trunk-fixes.tcl]
12
13 write_file a.txt "hello\n"
14 write_file f83.txt "line 83\n"
15 write_file f100.txt "line 100\n"
16 fossil add a.txt f83.txt f100.txt
@@ -43,16 +42,15 @@
43 }
44 }
45
46 # Run each row of TABLE: a test name, options for test-th-eval, a
47 # script, a mode and an expected value as th1main_check takes them.
48 # CONSTRAINTS is given to every test of the table.
49 #
50 proc th1main_table {table {constraints ""}} {
51 foreach {name opts script mode expected} $table {
52 set got [th1main_eval $script {*}$opts]
53 th1main_check th1main-$name $got $mode $expected $constraints
54 }
55 }
56
57 ###############################################################################
58 # Every command refuses a call with too few or too many arguments. Each
@@ -167,12 +165,11 @@
167 {http ?-asynchronous? ?--? url ?payload?}
168 capture-few {captureTh1} {captureTh1 STRING}
169 capture-many {captureTh1 a b} {captureTh1 STRING}
170 } {
171 test_eq th1main-args-$th1mainName [th1main_eval $th1mainCall] \
172 "TH_ERROR: wrong # args: should be \"$th1mainUsage\"" \
173 [trunk_mark $th1mainName {randhex-many http-none http-three}]
174 }
175
176 if {[test_assurance] ne "stress"} {
177 test_skip "the tests after the first sections need -assurance stress"
178 }
@@ -523,14 +520,14 @@
523 # Unversioned files.
524
525 # In a repository that has never held an unversioned file, "unversioned
526 # list" gives an empty list and "unversioned content" a script error.
527 set th1mainGot [th1main_eval {unversioned list}]
528 test th1main-uv-list-none {$CODE == 0 && $th1mainGot eq ""} $::trunkMark
529 set th1mainGot [th1main_eval {unversioned content nosuch}]
530 test th1main-uv-content-none \
531 {$CODE == 0 && [string match "TH_ERROR:*" $th1mainGot]} $::trunkMark
532
533 write_file u.txt "data\n"
534 write_file v.txt "more\n"
535 fossil uv add u.txt v.txt
536 fossil uv rm v.txt
@@ -556,14 +553,14 @@
556 fossil sql "SELECT substr(uuid,1,4) FROM blob GROUP BY 1 HAVING count(*)>1"
557 set th1mainPrefix [string trim $RESULT]
558 test_eq th1main-ambiguous-setup $th1mainPrefix 2b06
559 set th1mainGot [th1main_eval "artifact $th1mainPrefix"]
560 test th1main-artifact-ambiguous \
561 {$CODE == 0 && $th1mainGot eq "TH_ERROR: ambiguous name"} $::trunkMark
562 set th1mainGot [th1main_eval "artifact $th1mainPrefix a.txt"]
563 test th1main-artifact-ambiguous-checkin \
564 {$CODE == 0 && [string match "TH_ERROR: *" $th1mainGot]} $::trunkMark
565 test_eq th1main-dir-ambiguous [th1main_eval "dir $th1mainPrefix"] {}
566
567 # "setting -strict" and "http -asynchronous" with nothing after the
568 # option, and "http" with an empty first argument, give a script error.
569 foreach {th1mainName th1mainCall th1mainUsage} {
@@ -572,17 +569,17 @@
572 {http ?-asynchronous? ?--? url ?payload?}
573 http-empty {http {}} {http ?-asynchronous? ?--? url ?payload?}
574 } {
575 set th1mainGot [th1main_eval $th1mainCall]
576 test th1main-args-$th1mainName {$CODE == 0 && [string match \
577 "TH_ERROR: *" $th1mainGot]} $::trunkMark
578 }
579
580 # combobox with a second argument that is not a list gives a script error.
581 set th1mainGot [th1main_eval "combobox nm \"\{\" 1"]
582 test th1main-combobox-not-list \
583 {$CODE == 0 && [string match "*TH_ERROR: *" $th1mainGot]} $::trunkMark
584
585 # A query runs each of its statements once.
586 foreach {th1mainName th1mainSql} {
587 two {SELECT 1 AS a; SELECT 2 AS a}
588 space {SELECT 1 AS a; }
@@ -591,30 +588,27 @@
591 [join [list \
592 "set n 0; query {$th1mainSql} {set n \[expr {\$n+1}\]; if " \
593 "{\$n>50} {error endless}}; set n"] ""]
594 test th1main-query-statements-$th1mainName \
595 {$CODE == 0 && [string trim $RESULT] eq [dict get {two 2 space 1} \
596 $th1mainName]} $::trunkMark
597 }
598
599 # builtin_request_js with a name that is not a built-in file gives a
600 # script error.
601 set th1mainGot [th1main_eval {builtin_request_js nosuch.js}]
602 test th1main-requestjs-unknown {$CODE == 0} $::trunkMark
603
604 # randhex gives at most 50 bytes, 100 digits.
605 test_match th1main-randhex-50 [th1main_eval {randhex 50}] {^[0-9a-f]{100}$} \
606 [sanitizer_trunk_mark]
607 test th1main-randhex-50-exit {$CODE == 0} [sanitizer_trunk_mark]
608 test_match th1main-randhex-over [th1main_eval {randhex 1000}] \
609 {^[0-9a-f]{100}$} \
610 [sanitizer_trunk_mark]
611
612 # http with text that is not a URL gives a script error.
613 set th1mainGot [th1main_eval {http not-a-url}]
614 test th1main-http-not-url \
615 {$CODE == 0 && [string match "TH_ERROR: *" $th1mainGot]} $::trunkMark
616
617 # A phantom: an artifact whose content the repository does not hold.
618 set th1mainPhantom \
619 abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789
620 fossil sql "INSERT INTO blob(rcvid,size,uuid) VALUES(0,-1,'$th1mainPhantom');
@@ -743,11 +737,11 @@
743 {maybe_set default_csp } {set project_name [taint }}
744 } {
745 set th1mainGot [th1main_eval $th1mainScript --th-trace {*}$th1mainOpts]
746 test th1main-trace-$th1mainName {[holds_strings $th1mainGot [concat \
747 {{------------------ BEGIN TRACE LOG ------------------}} \
748 $th1mainWanted]]} [trunk_mark $th1mainName header]
749 }
750
751 ###############################################################################
752 # Templates: text with TH1 between <th1> and </th1>, $name for the value
753 # of a variable as it is and $<name> for its value escaped for HTML.
@@ -809,12 +803,11 @@
809 foreach {th1mainName th1mainText} {
810 break {a<th1>break</th1>after}
811 continue {a<th1>continue</th1>after}
812 return {a<th1>return 5</th1>after}
813 } {
814 test_eq th1main-render-$th1mainName [th1main_render $th1mainText] a \
815 $::trunkMark
816 }
817
818 # Text after a zero byte in the file is not rendered.
819 test_eq th1main-render-zero-byte [th1main_render "a\0b<th1>puts c</th1>"] a
820
@@ -1016,20 +1009,20 @@
1016 th1main_table {
1017 redirect-no-request {} {redirect /elsewhere}
1018 eq {TH_ERROR: redirect is only allowed in a web request }
1019 redirect-no-request-http {} {redirect http://example.com/}
1020 eq {TH_ERROR: redirect is only allowed in a web request }
1021 } $::trunkMark
1022 set th1mainGot [th1main_eval {redirect http://example.com/a} --cgi]
1023 test th1main-redirect-cgi-http {[holds_strings $th1mainGot [list \
1024 "Status: 302 " "Location: http://example.com/a\r\n"]]}
1025 set th1mainGot [th1main_eval {redirect https://example.com/a} --cgi]
1026 test th1main-redirect-cgi-https {[holds_strings $th1mainGot [list \
1027 "Status: 302 " "Location: https://example.com/a\r\n"]]}
1028 set th1mainGot [th1main_eval {redirect /relative} --cgi]
1029 test th1main-redirect-cgi-relative {[holds_strings $th1mainGot \
1030 {{redirect is only allowed in a web request} !Location}]} $::trunkMark
1031
1032 # verifyCsrf lets through only a POST from the same site that carries
1033 # the token insertCsrf wrote.
1034 set th1mainGot [th1main_page {<th1>insertCsrf</th1>}]
1035 regexp {name="csrf" value="([^"]+)"} $th1mainGot -> th1mainToken
1036
1037 ELETED test/trunk-fixes.tcl
--- test/th1main.test
+++ test/th1main.test
@@ -6,11 +6,10 @@
6 #
7
8 # The first sections run at every level, and the rest need
9 # -assurance stress.
10 test_setup
 
11
12 write_file a.txt "hello\n"
13 write_file f83.txt "line 83\n"
14 write_file f100.txt "line 100\n"
15 fossil add a.txt f83.txt f100.txt
@@ -43,16 +42,15 @@
42 }
43 }
44
45 # Run each row of TABLE: a test name, options for test-th-eval, a
46 # script, a mode and an expected value as th1main_check takes them.
 
47 #
48 proc th1main_table {table} {
49 foreach {name opts script mode expected} $table {
50 set got [th1main_eval $script {*}$opts]
51 th1main_check th1main-$name $got $mode $expected
52 }
53 }
54
55 ###############################################################################
56 # Every command refuses a call with too few or too many arguments. Each
@@ -167,12 +165,11 @@
165 {http ?-asynchronous? ?--? url ?payload?}
166 capture-few {captureTh1} {captureTh1 STRING}
167 capture-many {captureTh1 a b} {captureTh1 STRING}
168 } {
169 test_eq th1main-args-$th1mainName [th1main_eval $th1mainCall] \
170 "TH_ERROR: wrong # args: should be \"$th1mainUsage\""
 
171 }
172
173 if {[test_assurance] ne "stress"} {
174 test_skip "the tests after the first sections need -assurance stress"
175 }
@@ -523,14 +520,14 @@
520 # Unversioned files.
521
522 # In a repository that has never held an unversioned file, "unversioned
523 # list" gives an empty list and "unversioned content" a script error.
524 set th1mainGot [th1main_eval {unversioned list}]
525 test th1main-uv-list-none {$CODE == 0 && $th1mainGot eq ""}
526 set th1mainGot [th1main_eval {unversioned content nosuch}]
527 test th1main-uv-content-none \
528 {$CODE == 0 && [string match "TH_ERROR:*" $th1mainGot]}
529
530 write_file u.txt "data\n"
531 write_file v.txt "more\n"
532 fossil uv add u.txt v.txt
533 fossil uv rm v.txt
@@ -556,14 +553,14 @@
553 fossil sql "SELECT substr(uuid,1,4) FROM blob GROUP BY 1 HAVING count(*)>1"
554 set th1mainPrefix [string trim $RESULT]
555 test_eq th1main-ambiguous-setup $th1mainPrefix 2b06
556 set th1mainGot [th1main_eval "artifact $th1mainPrefix"]
557 test th1main-artifact-ambiguous \
558 {$CODE == 0 && $th1mainGot eq "TH_ERROR: ambiguous name"}
559 set th1mainGot [th1main_eval "artifact $th1mainPrefix a.txt"]
560 test th1main-artifact-ambiguous-checkin \
561 {$CODE == 0 && [string match "TH_ERROR: *" $th1mainGot]}
562 test_eq th1main-dir-ambiguous [th1main_eval "dir $th1mainPrefix"] {}
563
564 # "setting -strict" and "http -asynchronous" with nothing after the
565 # option, and "http" with an empty first argument, give a script error.
566 foreach {th1mainName th1mainCall th1mainUsage} {
@@ -572,17 +569,17 @@
569 {http ?-asynchronous? ?--? url ?payload?}
570 http-empty {http {}} {http ?-asynchronous? ?--? url ?payload?}
571 } {
572 set th1mainGot [th1main_eval $th1mainCall]
573 test th1main-args-$th1mainName {$CODE == 0 && [string match \
574 "TH_ERROR: *" $th1mainGot]}
575 }
576
577 # combobox with a second argument that is not a list gives a script error.
578 set th1mainGot [th1main_eval "combobox nm \"\{\" 1"]
579 test th1main-combobox-not-list \
580 {$CODE == 0 && [string match "*TH_ERROR: *" $th1mainGot]}
581
582 # A query runs each of its statements once.
583 foreach {th1mainName th1mainSql} {
584 two {SELECT 1 AS a; SELECT 2 AS a}
585 space {SELECT 1 AS a; }
@@ -591,30 +588,27 @@
588 [join [list \
589 "set n 0; query {$th1mainSql} {set n \[expr {\$n+1}\]; if " \
590 "{\$n>50} {error endless}}; set n"] ""]
591 test th1main-query-statements-$th1mainName \
592 {$CODE == 0 && [string trim $RESULT] eq [dict get {two 2 space 1} \
593 $th1mainName]}
594 }
595
596 # builtin_request_js with a name that is not a built-in file gives a
597 # script error.
598 set th1mainGot [th1main_eval {builtin_request_js nosuch.js}]
599 test th1main-requestjs-unknown {$CODE == 0}
600
601 # randhex gives at most 50 bytes, 100 digits.
602 test_match th1main-randhex-50 [th1main_eval {randhex 50}] {^[0-9a-f]{100}$}
603 test th1main-randhex-50-exit {$CODE == 0}
604 test_match th1main-randhex-over [th1main_eval {randhex 1000}] {^[0-9a-f]{100}$}
 
 
 
605
606 # http with text that is not a URL gives a script error.
607 set th1mainGot [th1main_eval {http not-a-url}]
608 test th1main-http-not-url \
609 {$CODE == 0 && [string match "TH_ERROR: *" $th1mainGot]}
610
611 # A phantom: an artifact whose content the repository does not hold.
612 set th1mainPhantom \
613 abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789
614 fossil sql "INSERT INTO blob(rcvid,size,uuid) VALUES(0,-1,'$th1mainPhantom');
@@ -743,11 +737,11 @@
737 {maybe_set default_csp } {set project_name [taint }}
738 } {
739 set th1mainGot [th1main_eval $th1mainScript --th-trace {*}$th1mainOpts]
740 test th1main-trace-$th1mainName {[holds_strings $th1mainGot [concat \
741 {{------------------ BEGIN TRACE LOG ------------------}} \
742 $th1mainWanted]]}
743 }
744
745 ###############################################################################
746 # Templates: text with TH1 between <th1> and </th1>, $name for the value
747 # of a variable as it is and $<name> for its value escaped for HTML.
@@ -809,12 +803,11 @@
803 foreach {th1mainName th1mainText} {
804 break {a<th1>break</th1>after}
805 continue {a<th1>continue</th1>after}
806 return {a<th1>return 5</th1>after}
807 } {
808 test_eq th1main-render-$th1mainName [th1main_render $th1mainText] a
 
809 }
810
811 # Text after a zero byte in the file is not rendered.
812 test_eq th1main-render-zero-byte [th1main_render "a\0b<th1>puts c</th1>"] a
813
@@ -1016,20 +1009,20 @@
1009 th1main_table {
1010 redirect-no-request {} {redirect /elsewhere}
1011 eq {TH_ERROR: redirect is only allowed in a web request }
1012 redirect-no-request-http {} {redirect http://example.com/}
1013 eq {TH_ERROR: redirect is only allowed in a web request }
1014 }
1015 set th1mainGot [th1main_eval {redirect http://example.com/a} --cgi]
1016 test th1main-redirect-cgi-http {[holds_strings $th1mainGot [list \
1017 "Status: 302 " "Location: http://example.com/a\r\n"]]}
1018 set th1mainGot [th1main_eval {redirect https://example.com/a} --cgi]
1019 test th1main-redirect-cgi-https {[holds_strings $th1mainGot [list \
1020 "Status: 302 " "Location: https://example.com/a\r\n"]]}
1021 set th1mainGot [th1main_eval {redirect /relative} --cgi]
1022 test th1main-redirect-cgi-relative {[holds_strings $th1mainGot \
1023 {{redirect is only allowed in a web request} !Location}]}
1024
1025 # verifyCsrf lets through only a POST from the same site that carries
1026 # the token insertCsrf wrote.
1027 set th1mainGot [th1main_page {<th1>insertCsrf</th1>}]
1028 regexp {name="csrf" value="([^"]+)"} $th1mainGot -> th1mainToken
1029
1030 ELETED test/trunk-fixes.tcl
D test/trunk-fixes.tcl
-58
--- a/test/trunk-fixes.tcl
+++ b/test/trunk-fixes.tcl
@@ -1,58 +0,0 @@
1
-#
2
-# Sourced by test files with tests of faults that are fixed on trunk. A
3
-# fossil built from an older trunk has those faults. Each such test
4
-# passes $trunkMark as its constraint: "knownBug" for a fossil with the
5
-# faults, so that their tests are reported but not counted as failures,
6
-# and empty for a fossil without them.
7
-#
8
-# A fossil with the fixes names randhex when TH1 randhex is given too many
9
-# arguments. The check needs no repository or check-out.
10
-#
11
-if {![info exists trunkMark]} {
12
- catch {exec $::fossilexe test-th-eval {randhex 1 2} 2>@1} trunkFixesReply
13
- if {[string first {should be "randhex} $trunkFixesReply] >= 0} {
14
- set trunkMark ""
15
- } else {
16
- set trunkMark knownBug
17
- }
18
-}
19
-
20
-# Some tests send input on which the address or undefined-behaviour
21
-# sanitizer reports a fault that is not fixed on trunk. Those tests are
22
-# skipped on a fossil built with a sanitizer. sanitizerBuild is 1 for
23
-# such a fossil: its file holds the sanitizer's entry points.
24
-#
25
-if {![info exists sanitizerBuild]} {
26
- set trunkFixesFd [open $::fossilexe rb]
27
- set trunkFixesBytes [read $trunkFixesFd]
28
- close $trunkFixesFd
29
- set sanitizerBuild [expr {
30
- [string first __asan_init $trunkFixesBytes] >= 0 ||
31
- [string first __ubsan_handle $trunkFixesBytes] >= 0}]
32
- unset trunkFixesBytes trunkFixesFd
33
-}
34
-
35
-# Return trunkMark if VALUE is one of VALUES, and an empty string
36
-# otherwise: the constraint for a test made in a loop, only some of whose
37
-# rounds test a fix on trunk.
38
-#
39
-proc trunk_mark {value values} {
40
- if {$value in $values} {
41
- return $::trunkMark
42
- }
43
- return ""
44
-}
45
-
46
-# The constraint for a test of a fix on trunk whose fault only a sanitizer
47
-# reports: trunkMark on a sanitizer build, and an empty string otherwise.
48
-# With VALUE and VALUES, as for trunk_mark.
49
-#
50
-proc sanitizer_trunk_mark {args} {
51
- if {!$::sanitizerBuild} {
52
- return ""
53
- }
54
- if {[llength $args] == 0} {
55
- return $::trunkMark
56
- }
57
- return [trunk_mark {*}$args]
58
-}
--- a/test/trunk-fixes.tcl
+++ b/test/trunk-fixes.tcl
@@ -1,58 +0,0 @@
1 #
2 # Sourced by test files with tests of faults that are fixed on trunk. A
3 # fossil built from an older trunk has those faults. Each such test
4 # passes $trunkMark as its constraint: "knownBug" for a fossil with the
5 # faults, so that their tests are reported but not counted as failures,
6 # and empty for a fossil without them.
7 #
8 # A fossil with the fixes names randhex when TH1 randhex is given too many
9 # arguments. The check needs no repository or check-out.
10 #
11 if {![info exists trunkMark]} {
12 catch {exec $::fossilexe test-th-eval {randhex 1 2} 2>@1} trunkFixesReply
13 if {[string first {should be "randhex} $trunkFixesReply] >= 0} {
14 set trunkMark ""
15 } else {
16 set trunkMark knownBug
17 }
18 }
19
20 # Some tests send input on which the address or undefined-behaviour
21 # sanitizer reports a fault that is not fixed on trunk. Those tests are
22 # skipped on a fossil built with a sanitizer. sanitizerBuild is 1 for
23 # such a fossil: its file holds the sanitizer's entry points.
24 #
25 if {![info exists sanitizerBuild]} {
26 set trunkFixesFd [open $::fossilexe rb]
27 set trunkFixesBytes [read $trunkFixesFd]
28 close $trunkFixesFd
29 set sanitizerBuild [expr {
30 [string first __asan_init $trunkFixesBytes] >= 0 ||
31 [string first __ubsan_handle $trunkFixesBytes] >= 0}]
32 unset trunkFixesBytes trunkFixesFd
33 }
34
35 # Return trunkMark if VALUE is one of VALUES, and an empty string
36 # otherwise: the constraint for a test made in a loop, only some of whose
37 # rounds test a fix on trunk.
38 #
39 proc trunk_mark {value values} {
40 if {$value in $values} {
41 return $::trunkMark
42 }
43 return ""
44 }
45
46 # The constraint for a test of a fix on trunk whose fault only a sanitizer
47 # reports: trunkMark on a sanitizer build, and an empty string otherwise.
48 # With VALUE and VALUES, as for trunk_mark.
49 #
50 proc sanitizer_trunk_mark {args} {
51 if {!$::sanitizerBuild} {
52 return ""
53 }
54 if {[llength $args] == 0} {
55 return $::trunkMark
56 }
57 return [trunk_mark {*}$args]
58 }
--- a/test/trunk-fixes.tcl
+++ b/test/trunk-fixes.tcl
@@ -1,58 +0,0 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
+15 -32
--- test/url.test
+++ test/url.test
@@ -35,11 +35,10 @@
3535
unset env($urlVar)
3636
}
3737
}
3838
3939
test_setup
40
-source [file join $::testfiledir trunk-fixes.tcl]
4140
set urlRepo [file join [pwd] .rep.fossil]
4241
set urlDir [pwd]
4342
4443
###############################################################################
4544
# The parts of a URL.
@@ -220,12 +219,11 @@
220219
port-letters http://h:80x/ {url missing '/' after port number}
221220
port-ipv6-junk {http://[::1]:8x} {url missing '/' after port number}
222221
} {
223222
fossil_raw test-urlparser $urlText --proxy off
224223
test url-parse-refused-$urlName \
225
- {$CODE == 1 && [string first $urlMessage $RESULT] >= 0} \
226
- [trunk_mark $urlName {port-too-large port-huge}]
224
+ {$CODE == 1 && [string first $urlMessage $RESULT] >= 0}
227225
}
228226
229227
# An ssh: URL with a host and no path has an empty path, and fossil
230228
# prints nothing but the parts of the URL.
231229
#
@@ -240,33 +238,28 @@
240238
user-host-port ssh://u@h:2222
241239
{isSsh 1 name h port 2222 path {} canonical ssh://u@h:2222}
242240
scheme-only ssh://
243241
{isSsh 1 name {} path {} canonical ssh://}
244242
} {
245
- url_parse_test url-parse-ssh-no-path-$urlName $urlText {} $urlExpected \
246
- [sanitizer_trunk_mark $urlName \
247
- {host user-host host-port user-host-port scheme-only}]
243
+ url_parse_test url-parse-ssh-no-path-$urlName $urlText {} $urlExpected
248244
test url-parse-ssh-no-path-$urlName-output {$CODE == 0 &&
249245
[regexp -all -line {^(g\.url\.\w+ +|url_full\(g\.url\) )= } $RESULT] ==
250
- [llength [split [string trim $RESULT] \n]]} \
251
- [sanitizer_trunk_mark $urlName \
252
- {host user-host host-port user-host-port scheme-only}]
246
+ [llength [split [string trim $RESULT] \n]]}
253247
}
254248
255249
# The complete URL of an ssh: remote has the "/" between the host and
256250
# the path.
257251
#
258252
url_parse_test url-parse-ssh-full ssh://u@h/dir/r.fossil {} \
259
- {full ssh://u@h/dir/r.fossil} $::trunkMark
253
+ {full ssh://u@h/dir/r.fossil}
260254
261255
# A second fossil= parameter is refused.
262256
#
263257
fossil_raw test-urlparser ssh://h/r.fossil?fossil=/a/fossil&fossil=/b/fossil \
264258
--proxy off
265259
test url-parse-ssh-fossil-twice {$CODE == 1 &&
266
- [string match "*more than one fossil= query parameter*" $RESULT]} \
267
- $::trunkMark
260
+ [string match "*more than one fossil= query parameter*" $RESULT]}
268261
269262
# A very long user name, password, host and path. The four together stay
270263
# under the 128 KB that Linux allows for one argument.
271264
#
272265
set urlLong [string repeat a 30000]
@@ -778,21 +771,20 @@
778771
status-401 "HTTP/1.1 401 Unauthorized\n\n" \
779772
{server says: 401 Unauthorized} \
780773
] {
781774
url_httpmsg [list [url_crlf $urlReply]] -v
782775
test_match url-http-refused-$urlName "$CODE $RESULT" \
783
- "^1 (?:.*\n)*.*$urlMessage" [trunk_mark $urlName redirect-to-bad-port]
776
+ "^1 (?:.*\n)*.*$urlMessage"
784777
url_httpmsg [list [url_crlf $urlReply]]
785
- test url-http-refused-quiet-$urlName {$CODE == 1} \
786
- [trunk_mark $urlName redirect-to-bad-port]
778
+ test url-http-refused-quiet-$urlName {$CODE == 1}
787779
}
788780
789781
# A redirect to an ssh: URL with no path is refused.
790782
#
791783
url_httpmsg [list [url_crlf "HTTP/1.1 302 Found\nLocation: ssh://h\n\n"]] -v
792784
test_match url-http-refused-redirect-to-ssh-no-path "$CODE $RESULT" \
793
- {^1 (?:.*\n)*.*cannot redirect to ssh://h} [sanitizer_trunk_mark]
785
+ {^1 (?:.*\n)*.*cannot redirect to ssh://h}
794786
795787
# A status line that test-httpmsg prints an error for without -v only
796788
# when it is not told to be quiet: it is quiet when it prints the reply
797789
# on standard output, and it is not when the reply goes to a file.
798790
#
@@ -809,15 +801,10 @@
809801
file delete out.txt
810802
url_httpmsg [list [url_crlf $urlReply]] --out out.txt
811803
test url-http-message-$urlName \
812804
{$CODE == 1 && [string first $urlMessage $RESULT] >= 0}
813805
url_httpmsg [list [url_crlf $urlReply]]
814
- if {$urlName eq "redirect-to-file" && $::sanitizerBuild} {
815
- test_skip_part "url-http-message-quiet-redirect-to-file: a sanitizer\
816
- reports the fault that 71f60497bb fixes, which is not on trunk"
817
- continue
818
- }
819806
test url-http-message-quiet-$urlName {$CODE == 1 && $RESULT eq ""}
820807
}
821808
822809
# A reply that is shorter than its Content-Length is an error, and only
823810
# the bytes that came are printed.
@@ -826,11 +813,11 @@
826813
file delete out.txt
827814
url_httpmsg [list $urlShort] --out out.txt
828815
test url-http-message-truncated {$CODE == 1 &&
829816
[string first "response truncated: got 5 bytes of 6" $RESULT] >= 0}
830817
url_httpmsg [list $urlShort]
831
-test url-http-truncated-bytes {$RESULT eq "hello"} $::trunkMark
818
+test url-http-truncated-bytes {$RESULT eq "hello"}
832819
833820
# A redirect is followed three times, with the same method and payload,
834821
# and the fourth is refused. 301, 302, 307 and 308 are followed. A
835822
# Location that ends in /xfer is used without that ending.
836823
#
@@ -1173,12 +1160,11 @@
11731160
payload.txt --xfer {*}$args
11741161
test_listen_stop
11751162
}
11761163
url_xfer_reply text/html "<p>no <b>such</b> page</p>" -v
11771164
test url-xfer-error-verbose {$CODE == 1 &&
1178
- [string first "server sends error: no such page" $RESULT] >= 0} \
1179
- $::trunkMark
1165
+ [string first "server sends error: no such page" $RESULT] >= 0}
11801166
url_xfer_reply text/html "plain text, no tags" -v
11811167
test url-xfer-error-plain-text {$CODE == 1 &&
11821168
[string first "server sends error: plain text, no tags" $RESULT] >= 0}
11831169
url_xfer_reply text/html "cut short <b" -v
11841170
test url-xfer-error-open-tag {$CODE == 1 &&
@@ -1263,20 +1249,19 @@
12631249
url_sync pull http://example.invalid/repo [list \
12641250
[url_crlf "HTTP/1.1 302 Found\nLocation: http://127.0.0.1:PORT/moved\n\n"] \
12651251
$urlNotFound] --once --proxy http://127.0.0.1:PORT
12661252
test url-sync-proxy-redirect {[llength $urlRequests] == 2 &&
12671253
[string match "POST http://127.0.0.1:*/moved HTTP/1.1" \
1268
- [url_request_line 1]]} $::trunkMark
1254
+ [url_request_line 1]]}
12691255
12701256
# A proxy is an http: or https: URL. With any other value fossil must
12711257
# not talk to the repository that the value names in place of the
12721258
# remote.
12731259
#
12741260
fossil_raw -seconds 60 clone http://example.invalid/repo proxyclone.fossil \
12751261
--proxy file://$urlRepo
1276
-test url-sync-proxy-file {$CODE == 1 && ![file exists proxyclone.fossil]} \
1277
- $::trunkMark
1262
+test url-sync-proxy-file {$CODE == 1 && ![file exists proxyclone.fossil]}
12781263
file delete proxyclone.fossil
12791264
12801265
# A pull through a proxy remembers the URL of the remote, not of the
12811266
# proxy. A proxy is not used for a file: URL.
12821267
#
@@ -1406,12 +1391,11 @@
14061391
--httptrace
14071392
test url-sync-clone-httptrace-no-reply {$CODE == 1 &&
14081393
![file exists traceclone.fossil] &&
14091394
[string first "cannot connect to host 127.0.0.1:$urlPort" $RESULT] >= 0}
14101395
test url-sync-clone-httptrace-no-reply-message \
1411
- {[string first "server returned an error - clone aborted" $RESULT] >= 0} \
1412
- $::trunkMark
1396
+ {[string first "server returned an error - clone aborted" $RESULT] >= 0}
14131397
file delete {*}[glob -nocomplain http-request-*.txt http-reply-*.txt]
14141398
14151399
# --transport-command with --httptrace prints the command. A command
14161400
# that fails, or writes no reply, is an error.
14171401
#
@@ -1459,12 +1443,11 @@
14591443
url_config last-sync-url 'http://[email protected]:$urlPort/repo'
14601444
fossil_raw -seconds 60 http --in xfersetup.txt --ipaddr 127.0.0.1 $urlRepo \
14611445
--localauth
14621446
test_listen_stop
14631447
test url-web-sync-no-password {[string first "HTTP/1.0 200 OK" $RESULT] == 0 &&
1464
- [string first "incorrect or missing password for user bob" $RESULT] >= 0} \
1465
- $::trunkMark
1448
+ [string first "incorrect or missing password for user bob" $RESULT] >= 0}
14661449
fossil sql "DELETE FROM config WHERE name GLOB 'last-sync-*'"
14671450
14681451
###############################################################################
14691452
# Links that web pages build from their own query parameters. Each row
14701453
# is a page and regular expressions for links that the page must have.
@@ -1739,15 +1722,15 @@
17391722
url_ssh [list $urlSshPull] pull ssh://hh/dir/r.fossil --once \
17401723
--proxy http://127.0.0.1:1
17411724
test url-ssh-proxy-not-used {$CODE == 0 && [url_ssh_runs] == 1 &&
17421725
[string first "via proxy" $RESULT] < 0}
17431726
url_ssh [list] pull http://example.invalid/repo --once --proxy ssh://hh/x
1744
- test url-ssh-proxy-is-ssh-url {[url_ssh_runs] == 0} $::trunkMark
1727
+ test url-ssh-proxy-is-ssh-url {[url_ssh_runs] == 0}
17451728
17461729
set env(PATH) $urlSavedPath
17471730
unset env(URL_SSH_DIR)
17481731
}
17491732
17501733
###############################################################################
17511734
17521735
array set env [array get urlSavedEnv]
17531736
test_cleanup
17541737
--- test/url.test
+++ test/url.test
@@ -35,11 +35,10 @@
35 unset env($urlVar)
36 }
37 }
38
39 test_setup
40 source [file join $::testfiledir trunk-fixes.tcl]
41 set urlRepo [file join [pwd] .rep.fossil]
42 set urlDir [pwd]
43
44 ###############################################################################
45 # The parts of a URL.
@@ -220,12 +219,11 @@
220 port-letters http://h:80x/ {url missing '/' after port number}
221 port-ipv6-junk {http://[::1]:8x} {url missing '/' after port number}
222 } {
223 fossil_raw test-urlparser $urlText --proxy off
224 test url-parse-refused-$urlName \
225 {$CODE == 1 && [string first $urlMessage $RESULT] >= 0} \
226 [trunk_mark $urlName {port-too-large port-huge}]
227 }
228
229 # An ssh: URL with a host and no path has an empty path, and fossil
230 # prints nothing but the parts of the URL.
231 #
@@ -240,33 +238,28 @@
240 user-host-port ssh://u@h:2222
241 {isSsh 1 name h port 2222 path {} canonical ssh://u@h:2222}
242 scheme-only ssh://
243 {isSsh 1 name {} path {} canonical ssh://}
244 } {
245 url_parse_test url-parse-ssh-no-path-$urlName $urlText {} $urlExpected \
246 [sanitizer_trunk_mark $urlName \
247 {host user-host host-port user-host-port scheme-only}]
248 test url-parse-ssh-no-path-$urlName-output {$CODE == 0 &&
249 [regexp -all -line {^(g\.url\.\w+ +|url_full\(g\.url\) )= } $RESULT] ==
250 [llength [split [string trim $RESULT] \n]]} \
251 [sanitizer_trunk_mark $urlName \
252 {host user-host host-port user-host-port scheme-only}]
253 }
254
255 # The complete URL of an ssh: remote has the "/" between the host and
256 # the path.
257 #
258 url_parse_test url-parse-ssh-full ssh://u@h/dir/r.fossil {} \
259 {full ssh://u@h/dir/r.fossil} $::trunkMark
260
261 # A second fossil= parameter is refused.
262 #
263 fossil_raw test-urlparser ssh://h/r.fossil?fossil=/a/fossil&fossil=/b/fossil \
264 --proxy off
265 test url-parse-ssh-fossil-twice {$CODE == 1 &&
266 [string match "*more than one fossil= query parameter*" $RESULT]} \
267 $::trunkMark
268
269 # A very long user name, password, host and path. The four together stay
270 # under the 128 KB that Linux allows for one argument.
271 #
272 set urlLong [string repeat a 30000]
@@ -778,21 +771,20 @@
778 status-401 "HTTP/1.1 401 Unauthorized\n\n" \
779 {server says: 401 Unauthorized} \
780 ] {
781 url_httpmsg [list [url_crlf $urlReply]] -v
782 test_match url-http-refused-$urlName "$CODE $RESULT" \
783 "^1 (?:.*\n)*.*$urlMessage" [trunk_mark $urlName redirect-to-bad-port]
784 url_httpmsg [list [url_crlf $urlReply]]
785 test url-http-refused-quiet-$urlName {$CODE == 1} \
786 [trunk_mark $urlName redirect-to-bad-port]
787 }
788
789 # A redirect to an ssh: URL with no path is refused.
790 #
791 url_httpmsg [list [url_crlf "HTTP/1.1 302 Found\nLocation: ssh://h\n\n"]] -v
792 test_match url-http-refused-redirect-to-ssh-no-path "$CODE $RESULT" \
793 {^1 (?:.*\n)*.*cannot redirect to ssh://h} [sanitizer_trunk_mark]
794
795 # A status line that test-httpmsg prints an error for without -v only
796 # when it is not told to be quiet: it is quiet when it prints the reply
797 # on standard output, and it is not when the reply goes to a file.
798 #
@@ -809,15 +801,10 @@
809 file delete out.txt
810 url_httpmsg [list [url_crlf $urlReply]] --out out.txt
811 test url-http-message-$urlName \
812 {$CODE == 1 && [string first $urlMessage $RESULT] >= 0}
813 url_httpmsg [list [url_crlf $urlReply]]
814 if {$urlName eq "redirect-to-file" && $::sanitizerBuild} {
815 test_skip_part "url-http-message-quiet-redirect-to-file: a sanitizer\
816 reports the fault that 71f60497bb fixes, which is not on trunk"
817 continue
818 }
819 test url-http-message-quiet-$urlName {$CODE == 1 && $RESULT eq ""}
820 }
821
822 # A reply that is shorter than its Content-Length is an error, and only
823 # the bytes that came are printed.
@@ -826,11 +813,11 @@
826 file delete out.txt
827 url_httpmsg [list $urlShort] --out out.txt
828 test url-http-message-truncated {$CODE == 1 &&
829 [string first "response truncated: got 5 bytes of 6" $RESULT] >= 0}
830 url_httpmsg [list $urlShort]
831 test url-http-truncated-bytes {$RESULT eq "hello"} $::trunkMark
832
833 # A redirect is followed three times, with the same method and payload,
834 # and the fourth is refused. 301, 302, 307 and 308 are followed. A
835 # Location that ends in /xfer is used without that ending.
836 #
@@ -1173,12 +1160,11 @@
1173 payload.txt --xfer {*}$args
1174 test_listen_stop
1175 }
1176 url_xfer_reply text/html "<p>no <b>such</b> page</p>" -v
1177 test url-xfer-error-verbose {$CODE == 1 &&
1178 [string first "server sends error: no such page" $RESULT] >= 0} \
1179 $::trunkMark
1180 url_xfer_reply text/html "plain text, no tags" -v
1181 test url-xfer-error-plain-text {$CODE == 1 &&
1182 [string first "server sends error: plain text, no tags" $RESULT] >= 0}
1183 url_xfer_reply text/html "cut short <b" -v
1184 test url-xfer-error-open-tag {$CODE == 1 &&
@@ -1263,20 +1249,19 @@
1263 url_sync pull http://example.invalid/repo [list \
1264 [url_crlf "HTTP/1.1 302 Found\nLocation: http://127.0.0.1:PORT/moved\n\n"] \
1265 $urlNotFound] --once --proxy http://127.0.0.1:PORT
1266 test url-sync-proxy-redirect {[llength $urlRequests] == 2 &&
1267 [string match "POST http://127.0.0.1:*/moved HTTP/1.1" \
1268 [url_request_line 1]]} $::trunkMark
1269
1270 # A proxy is an http: or https: URL. With any other value fossil must
1271 # not talk to the repository that the value names in place of the
1272 # remote.
1273 #
1274 fossil_raw -seconds 60 clone http://example.invalid/repo proxyclone.fossil \
1275 --proxy file://$urlRepo
1276 test url-sync-proxy-file {$CODE == 1 && ![file exists proxyclone.fossil]} \
1277 $::trunkMark
1278 file delete proxyclone.fossil
1279
1280 # A pull through a proxy remembers the URL of the remote, not of the
1281 # proxy. A proxy is not used for a file: URL.
1282 #
@@ -1406,12 +1391,11 @@
1406 --httptrace
1407 test url-sync-clone-httptrace-no-reply {$CODE == 1 &&
1408 ![file exists traceclone.fossil] &&
1409 [string first "cannot connect to host 127.0.0.1:$urlPort" $RESULT] >= 0}
1410 test url-sync-clone-httptrace-no-reply-message \
1411 {[string first "server returned an error - clone aborted" $RESULT] >= 0} \
1412 $::trunkMark
1413 file delete {*}[glob -nocomplain http-request-*.txt http-reply-*.txt]
1414
1415 # --transport-command with --httptrace prints the command. A command
1416 # that fails, or writes no reply, is an error.
1417 #
@@ -1459,12 +1443,11 @@
1459 url_config last-sync-url 'http://[email protected]:$urlPort/repo'
1460 fossil_raw -seconds 60 http --in xfersetup.txt --ipaddr 127.0.0.1 $urlRepo \
1461 --localauth
1462 test_listen_stop
1463 test url-web-sync-no-password {[string first "HTTP/1.0 200 OK" $RESULT] == 0 &&
1464 [string first "incorrect or missing password for user bob" $RESULT] >= 0} \
1465 $::trunkMark
1466 fossil sql "DELETE FROM config WHERE name GLOB 'last-sync-*'"
1467
1468 ###############################################################################
1469 # Links that web pages build from their own query parameters. Each row
1470 # is a page and regular expressions for links that the page must have.
@@ -1739,15 +1722,15 @@
1739 url_ssh [list $urlSshPull] pull ssh://hh/dir/r.fossil --once \
1740 --proxy http://127.0.0.1:1
1741 test url-ssh-proxy-not-used {$CODE == 0 && [url_ssh_runs] == 1 &&
1742 [string first "via proxy" $RESULT] < 0}
1743 url_ssh [list] pull http://example.invalid/repo --once --proxy ssh://hh/x
1744 test url-ssh-proxy-is-ssh-url {[url_ssh_runs] == 0} $::trunkMark
1745
1746 set env(PATH) $urlSavedPath
1747 unset env(URL_SSH_DIR)
1748 }
1749
1750 ###############################################################################
1751
1752 array set env [array get urlSavedEnv]
1753 test_cleanup
1754
--- test/url.test
+++ test/url.test
@@ -35,11 +35,10 @@
35 unset env($urlVar)
36 }
37 }
38
39 test_setup
 
40 set urlRepo [file join [pwd] .rep.fossil]
41 set urlDir [pwd]
42
43 ###############################################################################
44 # The parts of a URL.
@@ -220,12 +219,11 @@
219 port-letters http://h:80x/ {url missing '/' after port number}
220 port-ipv6-junk {http://[::1]:8x} {url missing '/' after port number}
221 } {
222 fossil_raw test-urlparser $urlText --proxy off
223 test url-parse-refused-$urlName \
224 {$CODE == 1 && [string first $urlMessage $RESULT] >= 0}
 
225 }
226
227 # An ssh: URL with a host and no path has an empty path, and fossil
228 # prints nothing but the parts of the URL.
229 #
@@ -240,33 +238,28 @@
238 user-host-port ssh://u@h:2222
239 {isSsh 1 name h port 2222 path {} canonical ssh://u@h:2222}
240 scheme-only ssh://
241 {isSsh 1 name {} path {} canonical ssh://}
242 } {
243 url_parse_test url-parse-ssh-no-path-$urlName $urlText {} $urlExpected
 
 
244 test url-parse-ssh-no-path-$urlName-output {$CODE == 0 &&
245 [regexp -all -line {^(g\.url\.\w+ +|url_full\(g\.url\) )= } $RESULT] ==
246 [llength [split [string trim $RESULT] \n]]}
 
 
247 }
248
249 # The complete URL of an ssh: remote has the "/" between the host and
250 # the path.
251 #
252 url_parse_test url-parse-ssh-full ssh://u@h/dir/r.fossil {} \
253 {full ssh://u@h/dir/r.fossil}
254
255 # A second fossil= parameter is refused.
256 #
257 fossil_raw test-urlparser ssh://h/r.fossil?fossil=/a/fossil&fossil=/b/fossil \
258 --proxy off
259 test url-parse-ssh-fossil-twice {$CODE == 1 &&
260 [string match "*more than one fossil= query parameter*" $RESULT]}
 
261
262 # A very long user name, password, host and path. The four together stay
263 # under the 128 KB that Linux allows for one argument.
264 #
265 set urlLong [string repeat a 30000]
@@ -778,21 +771,20 @@
771 status-401 "HTTP/1.1 401 Unauthorized\n\n" \
772 {server says: 401 Unauthorized} \
773 ] {
774 url_httpmsg [list [url_crlf $urlReply]] -v
775 test_match url-http-refused-$urlName "$CODE $RESULT" \
776 "^1 (?:.*\n)*.*$urlMessage"
777 url_httpmsg [list [url_crlf $urlReply]]
778 test url-http-refused-quiet-$urlName {$CODE == 1}
 
779 }
780
781 # A redirect to an ssh: URL with no path is refused.
782 #
783 url_httpmsg [list [url_crlf "HTTP/1.1 302 Found\nLocation: ssh://h\n\n"]] -v
784 test_match url-http-refused-redirect-to-ssh-no-path "$CODE $RESULT" \
785 {^1 (?:.*\n)*.*cannot redirect to ssh://h}
786
787 # A status line that test-httpmsg prints an error for without -v only
788 # when it is not told to be quiet: it is quiet when it prints the reply
789 # on standard output, and it is not when the reply goes to a file.
790 #
@@ -809,15 +801,10 @@
801 file delete out.txt
802 url_httpmsg [list [url_crlf $urlReply]] --out out.txt
803 test url-http-message-$urlName \
804 {$CODE == 1 && [string first $urlMessage $RESULT] >= 0}
805 url_httpmsg [list [url_crlf $urlReply]]
 
 
 
 
 
806 test url-http-message-quiet-$urlName {$CODE == 1 && $RESULT eq ""}
807 }
808
809 # A reply that is shorter than its Content-Length is an error, and only
810 # the bytes that came are printed.
@@ -826,11 +813,11 @@
813 file delete out.txt
814 url_httpmsg [list $urlShort] --out out.txt
815 test url-http-message-truncated {$CODE == 1 &&
816 [string first "response truncated: got 5 bytes of 6" $RESULT] >= 0}
817 url_httpmsg [list $urlShort]
818 test url-http-truncated-bytes {$RESULT eq "hello"}
819
820 # A redirect is followed three times, with the same method and payload,
821 # and the fourth is refused. 301, 302, 307 and 308 are followed. A
822 # Location that ends in /xfer is used without that ending.
823 #
@@ -1173,12 +1160,11 @@
1160 payload.txt --xfer {*}$args
1161 test_listen_stop
1162 }
1163 url_xfer_reply text/html "<p>no <b>such</b> page</p>" -v
1164 test url-xfer-error-verbose {$CODE == 1 &&
1165 [string first "server sends error: no such page" $RESULT] >= 0}
 
1166 url_xfer_reply text/html "plain text, no tags" -v
1167 test url-xfer-error-plain-text {$CODE == 1 &&
1168 [string first "server sends error: plain text, no tags" $RESULT] >= 0}
1169 url_xfer_reply text/html "cut short <b" -v
1170 test url-xfer-error-open-tag {$CODE == 1 &&
@@ -1263,20 +1249,19 @@
1249 url_sync pull http://example.invalid/repo [list \
1250 [url_crlf "HTTP/1.1 302 Found\nLocation: http://127.0.0.1:PORT/moved\n\n"] \
1251 $urlNotFound] --once --proxy http://127.0.0.1:PORT
1252 test url-sync-proxy-redirect {[llength $urlRequests] == 2 &&
1253 [string match "POST http://127.0.0.1:*/moved HTTP/1.1" \
1254 [url_request_line 1]]}
1255
1256 # A proxy is an http: or https: URL. With any other value fossil must
1257 # not talk to the repository that the value names in place of the
1258 # remote.
1259 #
1260 fossil_raw -seconds 60 clone http://example.invalid/repo proxyclone.fossil \
1261 --proxy file://$urlRepo
1262 test url-sync-proxy-file {$CODE == 1 && ![file exists proxyclone.fossil]}
 
1263 file delete proxyclone.fossil
1264
1265 # A pull through a proxy remembers the URL of the remote, not of the
1266 # proxy. A proxy is not used for a file: URL.
1267 #
@@ -1406,12 +1391,11 @@
1391 --httptrace
1392 test url-sync-clone-httptrace-no-reply {$CODE == 1 &&
1393 ![file exists traceclone.fossil] &&
1394 [string first "cannot connect to host 127.0.0.1:$urlPort" $RESULT] >= 0}
1395 test url-sync-clone-httptrace-no-reply-message \
1396 {[string first "server returned an error - clone aborted" $RESULT] >= 0}
 
1397 file delete {*}[glob -nocomplain http-request-*.txt http-reply-*.txt]
1398
1399 # --transport-command with --httptrace prints the command. A command
1400 # that fails, or writes no reply, is an error.
1401 #
@@ -1459,12 +1443,11 @@
1443 url_config last-sync-url 'http://[email protected]:$urlPort/repo'
1444 fossil_raw -seconds 60 http --in xfersetup.txt --ipaddr 127.0.0.1 $urlRepo \
1445 --localauth
1446 test_listen_stop
1447 test url-web-sync-no-password {[string first "HTTP/1.0 200 OK" $RESULT] == 0 &&
1448 [string first "incorrect or missing password for user bob" $RESULT] >= 0}
 
1449 fossil sql "DELETE FROM config WHERE name GLOB 'last-sync-*'"
1450
1451 ###############################################################################
1452 # Links that web pages build from their own query parameters. Each row
1453 # is a page and regular expressions for links that the page must have.
@@ -1739,15 +1722,15 @@
1722 url_ssh [list $urlSshPull] pull ssh://hh/dir/r.fossil --once \
1723 --proxy http://127.0.0.1:1
1724 test url-ssh-proxy-not-used {$CODE == 0 && [url_ssh_runs] == 1 &&
1725 [string first "via proxy" $RESULT] < 0}
1726 url_ssh [list] pull http://example.invalid/repo --once --proxy ssh://hh/x
1727 test url-ssh-proxy-is-ssh-url {[url_ssh_runs] == 0}
1728
1729 set env(PATH) $urlSavedPath
1730 unset env(URL_SSH_DIR)
1731 }
1732
1733 ###############################################################################
1734
1735 array set env [array get urlSavedEnv]
1736 test_cleanup
1737
--- test/xfer-client.test
+++ test/xfer-client.test
@@ -16,11 +16,10 @@
1616
if {$::tcl_platform(platform) eq "windows"} {
1717
test_skip "the stand-in for a server is a shell script"
1818
}
1919
2020
test_setup
21
-source [file join $::testfiledir trunk-fixes.tcl]
2221
2322
write_file a.txt "hello world\n"
2423
fossil add a.txt
2524
fossil commit -m one --no-warnings
2625
fossil sha3sum a.txt
@@ -411,12 +410,11 @@
411410
] {
412411
fossil sql "DELETE FROM config WHERE name LIKE 'link:%'"
413412
xferclient_run pull $xferclientCard --share-links
414413
fossil sql "SELECT count(*) FROM config WHERE name LIKE 'link:%'"
415414
test_eq xfer-client-mcdc-link-$xferclientName \
416
- "$xferclientCode [string trim $RESULT]" "0 $xferclientKept" \
417
- [trunk_mark $xferclientName {ftp no-scheme}]
415
+ "$xferclientCode [string trim $RESULT]" "0 $xferclientKept"
418416
}
419417
420418
###############################################################################
421419
# A "private" card makes the next file private. A client that does not sync
422420
# private content ignores that file, whatever its content; one that does
423421
--- test/xfer-client.test
+++ test/xfer-client.test
@@ -16,11 +16,10 @@
16 if {$::tcl_platform(platform) eq "windows"} {
17 test_skip "the stand-in for a server is a shell script"
18 }
19
20 test_setup
21 source [file join $::testfiledir trunk-fixes.tcl]
22
23 write_file a.txt "hello world\n"
24 fossil add a.txt
25 fossil commit -m one --no-warnings
26 fossil sha3sum a.txt
@@ -411,12 +410,11 @@
411 ] {
412 fossil sql "DELETE FROM config WHERE name LIKE 'link:%'"
413 xferclient_run pull $xferclientCard --share-links
414 fossil sql "SELECT count(*) FROM config WHERE name LIKE 'link:%'"
415 test_eq xfer-client-mcdc-link-$xferclientName \
416 "$xferclientCode [string trim $RESULT]" "0 $xferclientKept" \
417 [trunk_mark $xferclientName {ftp no-scheme}]
418 }
419
420 ###############################################################################
421 # A "private" card makes the next file private. A client that does not sync
422 # private content ignores that file, whatever its content; one that does
423
--- test/xfer-client.test
+++ test/xfer-client.test
@@ -16,11 +16,10 @@
16 if {$::tcl_platform(platform) eq "windows"} {
17 test_skip "the stand-in for a server is a shell script"
18 }
19
20 test_setup
 
21
22 write_file a.txt "hello world\n"
23 fossil add a.txt
24 fossil commit -m one --no-warnings
25 fossil sha3sum a.txt
@@ -411,12 +410,11 @@
410 ] {
411 fossil sql "DELETE FROM config WHERE name LIKE 'link:%'"
412 xferclient_run pull $xferclientCard --share-links
413 fossil sql "SELECT count(*) FROM config WHERE name LIKE 'link:%'"
414 test_eq xfer-client-mcdc-link-$xferclientName \
415 "$xferclientCode [string trim $RESULT]" "0 $xferclientKept"
 
416 }
417
418 ###############################################################################
419 # A "private" card makes the next file private. A client that does not sync
420 # private content ignores that file, whatever its content; one that does
421
--- test/xfer-server.test
+++ test/xfer-server.test
@@ -12,11 +12,10 @@
1212
# The first sections run at every level, and the rest need
1313
# -assurance stress.
1414
require_no_open_checkout
1515
1616
test_setup
17
-source [file join $::testfiledir trunk-fixes.tcl]
1817
1918
write_file a.txt "hello world\n"
2019
fossil add a.txt
2120
fossil commit -m one --no-warnings
2221
fossil sha3sum a.txt
@@ -202,14 +201,13 @@
202201
{[xferserver_count \
203202
"config WHERE name GLOB 'syncfrom:*example.org*'"] == 1}
204203
# A client URL that is not http or https is ignored and the request goes
205204
# on; it is not read as a path on the server.
206205
foreach {xferserverName xferserverUrl} {ftp ftp://example.org/y path /} {
207
- xferserver_send "${xferserverPush}pragma client-url $xferserverUrl\n"
208
- test xfer-server-write-client-url-$xferserverName {$::CODE == 0 &&
209
- [holds_strings $::RESULT {{!unknown repository} {errors 0}}]} \
210
- $::trunkMark
206
+ xferserver_expect write-client-url-$xferserverName \
207
+ "${xferserverPush}pragma client-url $xferserverUrl\n" \
208
+ "!unknown repository" "errors 0"
211209
}
212210
213211
# A first word that has the length of a card name and is not it selects no
214212
# card. A pragma with a name of the length of a known one that is not it
215213
# does nothing.
@@ -440,16 +438,16 @@
440438
xferserver_set gitpush:https://git.example.org/someone/mirror.git "{}"
441439
xferserver_set gitpush:[email protected]:someone/other.git "{}"
442440
xferserver_set gitpush:[email protected]:someone/other.git "{}"
443441
xferserver_send "${xferserverPull}pragma req-links\n"
444442
test xfer-server-read-req-links-git-address \
445
- {$CODE == 0 && [string first "errors 0" $RESULT] >= 0} $::trunkMark
443
+ {$CODE == 0 && [string first "errors 0" $RESULT] >= 0}
446444
test xfer-server-read-req-links-git-https \
447445
{[string match "*pragma link https://git.example.org/someone/mirror.git*" \
448
- $RESULT]} $::trunkMark
446
+ $RESULT]}
449447
test xfer-server-read-req-links-git-other-left-out \
450
- {![string match "*other.git*" $RESULT]} $::trunkMark
448
+ {![string match "*other.git*" $RESULT]}
451449
xferserver_unset gitpush:*
452450
453451
# The address configuration is given only to a client that may read
454452
# addresses.
455453
xferserver_caps "oe"
456454
--- test/xfer-server.test
+++ test/xfer-server.test
@@ -12,11 +12,10 @@
12 # The first sections run at every level, and the rest need
13 # -assurance stress.
14 require_no_open_checkout
15
16 test_setup
17 source [file join $::testfiledir trunk-fixes.tcl]
18
19 write_file a.txt "hello world\n"
20 fossil add a.txt
21 fossil commit -m one --no-warnings
22 fossil sha3sum a.txt
@@ -202,14 +201,13 @@
202 {[xferserver_count \
203 "config WHERE name GLOB 'syncfrom:*example.org*'"] == 1}
204 # A client URL that is not http or https is ignored and the request goes
205 # on; it is not read as a path on the server.
206 foreach {xferserverName xferserverUrl} {ftp ftp://example.org/y path /} {
207 xferserver_send "${xferserverPush}pragma client-url $xferserverUrl\n"
208 test xfer-server-write-client-url-$xferserverName {$::CODE == 0 &&
209 [holds_strings $::RESULT {{!unknown repository} {errors 0}}]} \
210 $::trunkMark
211 }
212
213 # A first word that has the length of a card name and is not it selects no
214 # card. A pragma with a name of the length of a known one that is not it
215 # does nothing.
@@ -440,16 +438,16 @@
440 xferserver_set gitpush:https://git.example.org/someone/mirror.git "{}"
441 xferserver_set gitpush:[email protected]:someone/other.git "{}"
442 xferserver_set gitpush:[email protected]:someone/other.git "{}"
443 xferserver_send "${xferserverPull}pragma req-links\n"
444 test xfer-server-read-req-links-git-address \
445 {$CODE == 0 && [string first "errors 0" $RESULT] >= 0} $::trunkMark
446 test xfer-server-read-req-links-git-https \
447 {[string match "*pragma link https://git.example.org/someone/mirror.git*" \
448 $RESULT]} $::trunkMark
449 test xfer-server-read-req-links-git-other-left-out \
450 {![string match "*other.git*" $RESULT]} $::trunkMark
451 xferserver_unset gitpush:*
452
453 # The address configuration is given only to a client that may read
454 # addresses.
455 xferserver_caps "oe"
456
--- test/xfer-server.test
+++ test/xfer-server.test
@@ -12,11 +12,10 @@
12 # The first sections run at every level, and the rest need
13 # -assurance stress.
14 require_no_open_checkout
15
16 test_setup
 
17
18 write_file a.txt "hello world\n"
19 fossil add a.txt
20 fossil commit -m one --no-warnings
21 fossil sha3sum a.txt
@@ -202,14 +201,13 @@
201 {[xferserver_count \
202 "config WHERE name GLOB 'syncfrom:*example.org*'"] == 1}
203 # A client URL that is not http or https is ignored and the request goes
204 # on; it is not read as a path on the server.
205 foreach {xferserverName xferserverUrl} {ftp ftp://example.org/y path /} {
206 xferserver_expect write-client-url-$xferserverName \
207 "${xferserverPush}pragma client-url $xferserverUrl\n" \
208 "!unknown repository" "errors 0"
 
209 }
210
211 # A first word that has the length of a card name and is not it selects no
212 # card. A pragma with a name of the length of a known one that is not it
213 # does nothing.
@@ -440,16 +438,16 @@
438 xferserver_set gitpush:https://git.example.org/someone/mirror.git "{}"
439 xferserver_set gitpush:[email protected]:someone/other.git "{}"
440 xferserver_set gitpush:[email protected]:someone/other.git "{}"
441 xferserver_send "${xferserverPull}pragma req-links\n"
442 test xfer-server-read-req-links-git-address \
443 {$CODE == 0 && [string first "errors 0" $RESULT] >= 0}
444 test xfer-server-read-req-links-git-https \
445 {[string match "*pragma link https://git.example.org/someone/mirror.git*" \
446 $RESULT]}
447 test xfer-server-read-req-links-git-other-left-out \
448 {![string match "*other.git*" $RESULT]}
449 xferserver_unset gitpush:*
450
451 # The address configuration is given only to a client that may read
452 # addresses.
453 xferserver_caps "oe"
454

Keyboard Shortcuts

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