Success!
# TOTAL: 1
# PASS: 1
# SKIP: 0
# XFAIL: 0
# FAIL: 0
# XPASS: 0
# ERROR: 0
I've attached the logs again, just in case.
Thanks for looking into this!
On Mon, Aug 24, 2015, at 18:07, Ludovic Courtès wrote:
> Leo Famulari skribis:
>
> > On Thu, Aug 20, 2015, at 06:02, Ludovic Courtès wrote:
>
> [...]
>
> >> I suspect the ‘nlink’ count on directories work differently on btrfs, or
> >> something like that.
>
> [...]
>
> > Starting test nar (Writing full log to "nar.log")
> >
> > ;;; (stat-output "./test-nar-7151" 1)
> > tests/nar.scm:203: FAIL write-file + restore-file
> >
> > ;;; (stat-output "./test-nar-7151" 1)
> > tests/nar.scm:220: FAIL write-file + restore-file with symlinks
>
> Indeed, that confirms what I thought.
>
> This looks like buggy or at least borderline behavior from Btrfs.
> However, it seems that this ‘nlink’ test can be sidestepped altogether.
>
> Could you apply this last patch and run:
>
> make check TESTS=tests/nar.scm
>
> again?
>
> If it works for you, I’ll just apply it.
>
> Thanks!
>
> Ludo’.
>
> Email had 1 attachment:
> + Attachment2
> 1k (text/x-patch)
Starting test nar
Group begin: nar
Test begin:
test-name: "write-file supports non-file output ports"
source-file: "tests/nar.scm"
source-line: 165
source-form: (test-assert "write-file supports non-file output ports" (let ((input (string-append (dirname (search-path %load-path "guix.scm")) "/guix")) (output (%make-void-port "w"))) (write-file input output) #t))
Test end:
result-kind: pass
actual-value: #t
Test begin:
test-name: "write-file puts file in C locale collation order"
source-file: "tests/nar.scm"
source-line: 172
source-form: (test-equal "write-file puts file in C locale collation order" (base32 "0sfn5r63k88w9ls4hivnvscg82bqg8a0w7955l6xlk4g96jnb2z3") (let ((input (string-append %test-dir ".input"))) (dynamic-wind (lambda () (define (touch file) (call-with-output-file (string-append input "/" file) (const #t))) (mkdir input) (touch "B") (touch "Z") (touch "a") (symlink "B" (string-append input "/z"))) (lambda () (let-values (((port get-hash) (open-sha256-port))) (write-file input port) (get-hash))) (lambda () (rm-rf input)
Test end:
result-kind: pass
actual-value: #vu8(227 139 101 165 73 143 76 218 13 45 37 29 14 20 122 120 9 244 152 222 118 71 72 52 77 28 161 57 76 46 214 105)
expected-value: #vu8(227 139 101 165 73 143 76 218 13 45 37 29 14 20 122 120 9 244 152 222 118 71 72 52 77 28 161 57 76 46 214 105)
Test begin:
test-name: "restore-file with incomplete input"
source-file: "tests/nar.scm"
source-line: 193
source-form: (test-equal "restore-file with incomplete input" (string-append %test-dir "/foo") (let ((port (open-bytevector-input-port #vu8(1 2 3 (guard (c ((nar-error? c) (and (eq? port (nar-error-port c)) (nar-error-file c (restore-file port (string-append %test-dir "/foo")) #f)))
Test end:
result-kind: pass
actual-value: "./test-nar-27645/foo"
expected-value: "./test-nar-27645/foo"
Test begin:
test-name: "write-file + restore-file"
source-file: "tests/nar.scm"
source-line: 202
source-form: (test-assert "write-file + restore-file" (let* ((input (string-append (dirname (search-path %load-path "guix.scm")) "/guix")) (output %test-dir) (nar (string-append output ".nar"))) (dynamic-wind (lambda () #t) (lambda () (call-with-output-file nar (cut write-file input <>)) (call-with-input-file nar (cut restore-file <> output)) (file-tree-equal? input output)) (lambda () (false-if-exception (delete-file nar)) (false-if-exception (rm-rf output))
Test end:
result-kind: pass
actual-value: #t
Test begin:
test-name: "write-file + restore-file with symlinks"
source-file: "tests/nar.scm"
source-line: 219
source-form: (test-assert "write-file + restore-file with symlinks" (let ((input (string-append %test-dir ".input"))) (mkdir input) (dynamic-wind (const #t) (lambda () (with-file-tree input (directory "root" (("reg") ("exe" 511) ("sym" -> "reg"))) (let* ((output %test-dir) (nar (string-append output ".nar"))) (dynamic-wind (lambda () #t) (lambda () (call-with-output-file nar (cut write-file input <>)) (call-with-input-file nar (cut restore-file <> output)) (file-tree-equal? input output)) (lambda () (false-if-exception (delete-file nar)) (false-if-exception (rm-rf output))) (lambda () (rmdir input)
Test end:
result-kind: pass
actual-value: #t
Test begin:
test-name: "restore-file-set (signed, valid)"
source-file: "tests/nar.scm"
source-line: 251
source-form: (test-assert "restore-file-set (signed, valid)" (with-store store (let* ((texts (unfold (cut >= <> 10) (lambda _ (random-text)) #{1+}# 0)) (files (map (cut add-text-to-store store "text" <>) texts)) (dump (call-with-bytevector-output-port (cut export-paths store files <> (delete-paths store files) (and (every (negate file-exists?) files) (let* ((source (open-bytevector-input-port dump)) (imported (restore-file-set source))) (and (equal? i