summaryrefslogtreecommitdiff
path: root/tests/nar.scm
AgeCommit message (Collapse)Author
2015-08-26tests: Work around Btrfs handling of nlink for empty directories.Ludovic Courtès
Fixes <http://bugs.gnu.org/21280>. Reported by Leo Famulari <leo@famulari.name>. * tests/nar.scm (file-tree-equal?): Use #t as the initial result. Btrfs would set nlink to 1 instead of 2 for an empty directory, thereby leading 'file-tree-equal?' to return #f.
2015-06-24tests: Move 'file=?' to (guix tests).Ludovic Courtès
* tests/nar.scm (file-tree-equal?)[file=?]: Move to... * guix/tests.scm (file=?): ... here. New procedure.
2015-02-07serialization: Check for EOF and incomplete input conditions.Ludovic Courtès
Fixes <http://bugs.gnu.org/19756>. Reported by <sleep_walker@suse.cz>. * guix/serialization.scm (currently-restored-file): New variable. (get-bytevector-n*): New procedure. (read-int, read-long-long, read-string, read-latin1-string, read-contents): Use it instead of 'get-bytevector-n'. (restore-file): Parameterize 'currently-restored-file' and set it. * tests/nar.scm ("restore-file with incomplete input"): New test.
2014-11-04tests: When a store item is to be deleted, make it statistically unique.Ludovic Courtès
Fixes <http://bugs.gnu.org/18935>. Reported by Mark H Weaver <mhw@netris.org>. Previously, if tests/nar.scm ran concurrently with tests/gexp.scm, the store item "foo" containing the string "Hello, world!" could be deleted (via 'delete-paths') from the tests/nar.scm daemon while the tests/gexp.scm daemon would still consider it live. * tests/nar.scm ("restore-file-set (missing signature)"): Use (random-text) rather than "Hello, world!", to avoid concurrent deletion of store item "foo" used in tests/gexp.scm.
2014-10-09Break module cycle involving (guix store) and (guix ui).Ludovic Courtès
Before, there was a cycle along the lines of: (guix store) -> (guix nar) -> (guix ui) -> (guix store) This caused problems, as discussed at: http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00109.html This patch removes cycles in the (guix ...) modules. * guix/nar.scm (&nar-error, &nar-read-error, dump, write-contents, read-contents, %archive-version-1, write-file, restore-file): Move to... * guix/serialization.scm: ... here. * guix/store.scm: Remove dependency on (guix nar). * guix/scripts/hash.scm, guix/scripts/offload.scm, guix/scripts/substitute-binary.scm, tests/nar.scm, tests/store.scm, tests/substitute-binary.scm: Adjust accordingly.
2014-08-23Factorize test suite support in (guix tests).Ludovic Courtès
* guix/tests.scm: New file. * Makefile.am (noinst_DATA): New variable. (GOBJECTS): Add guix/tests.go. * tests/builders.scm (%store): Use 'open-connection-for-tests' from (guix tests). * tests/derivations.scm: Likewise. * tests/monads.scm: Likewise. * tests/packages.scm: Likewise. * tests/profiles.scm: Likewise. * tests/union.scm: Likewise. * tests/gexp.scm: Likewise. (guile-for-build): Remove. Use (%guile-for-build) instead. * tests/nar.scm (make-random-bytevector, %seed, random-text): Remove. (populate-file): Change 'make-random-bytevector' to 'random-bytevector'. Use (guix tests). * tests/store.scm (%seed, random-text): Remove. Use (guix tests).
2014-02-21nar: Produce archives with files sorted in C collation order.Ludovic Courtès
* guix/nar.scm (write-file) <directory>: Pass 'string<?' as the second argument to 'scandir'. * tests/nar.scm ("write-file puts file in C locale collation order"): New test.
2014-02-21nar: 'write-file' can write to non-file ports.Ludovic Courtès
* guix/nar.scm (write-contents): Use 'sendfile' only when P is a file port. * tests/nar.scm ("write-file supports non-file output ports"): New test.
2014-01-24nar: Add 'restore-file-set', for use by build hooks.Ludovic Courtès
* guix/nar.scm (&nar-invalid-hash-error, &nar-signature-error): New condition types. (&nar-error): Add 'file' and 'port' fields. (&nar-read-error): Remove 'port' and 'file' fields. (lock-store-file, unlock-store-file, finalize-store-file, temporary-store-directory, restore-file-set): New procedures. * tests/nar.scm (%seed): New variable. (random-text): New procedure. ("restore-file-set (signed, valid)", "restore-file-set (missing signature)", "restore-file-set (corrupt)"): New tests. * po/Makevars (XGETTEXT_OPTIONS): Add '--keyword=message'.nar fixes * po/POTFILES.in: Add guix/nar.scm.
2013-05-11tests: Fix out-of-source builds.Ludovic Courtès
* tests/nar.scm (%test-dir): Compute relative to `pre-inst-env', which is in $top_builddir.
2013-04-12tests: Remove temporary directory created by nar.scm.Ludovic Courtès
* tests/nar.scm ("write-file + restore-file with symlinks"): Add (rm-rf output).
2013-04-12nar: Add support for symlinks.Ludovic Courtès
* guix/nar.scm (write-file): Add case for type `symlink'. (restore-file): Likewise. * tests/nar.scm (random-file-size, make-file-tree, delete-file-tree, with-file-tree, file-tree-equal?, make-random-bytevector, populate-file): New procedures. (%test-dir): New variable. ("write-file + restore-file"): Use `%test-dir' and `file-tree-equal?'. ("write-file + restore-file with symlinks"): New test.
2013-04-08nar: Implement restoration from Nar.Ludovic Courtès
* guix/nar.scm (&nar-error, &nar-read-error): New condition types. (dump): New procedure. (write-contents)[dump]: Remove. Use the one above instead. (read-contents, write-file, restore-file): New procedures. (%archive-version-1): New variable.