Derive([("out","/nix/store/yd0v41r8kj49xcjric62gk47lss9vdyg-hurd-qemu-test-build","","")],[("/nix/store/2fgw8gkxs1k8hfcsvir3q9wnkifdzs2s-bash-4.2-p20.drv",["out"]),("/nix/store/31n2fn5h1gydqs3a9zm5g40d2f886i7g-gnused-4.2.1-i586-pc-gnu.drv",["out"]),("/nix/store/34y69yzzb9a1v1fmixiqfhip9s57pybf-gnugrep-2.10-i586-pc-gnu.drv",["out"]),("/nix/store/6n80yhr7cwip45w8rccyk4bp7g7zlkwq-gnu-global-user-environment.drv",["out"]),("/nix/store/88ymj8xwrkmadyabbc1z96x4prabkhsx-gnumake-3.82-i586-pc-gnu.drv",["out"]),("/nix/store/8c61y42zw57axxixl0wikq6vszjbf9bw-qemu-kvm-0.15.1.drv",["out"]),("/nix/store/8dd520i02y7pkh5ynm7d5jb2lk0m7wzn-mig-20100512-i586-pc-gnu.drv",["out"]),("/nix/store/b4lcngrsl838jg37yn510g888nlf0f1v-gawk-4.0.0-i586-pc-gnu.drv",["out"]),("/nix/store/c4bq6crxpl4y9wd18fkvn81vj93m9wph-findutils-4.4.2-i586-pc-gnu.drv",["out"]),("/nix/store/dgbh8qzl4rr89jsrlsy382z84lmfwsj1-bzip2-1.0.6-i586-pc-gnu.drv",["out"]),("/nix/store/dsplzdbcqwgi9ybb7pfk5z9w6vxbn48h-diffutils-3.2-i586-pc-gnu.drv",["out"
aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014 Nikita Karetnikov <nikita@karetnikov.org>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (test-base64)
  #:use-module (guix base64)
  #:use-module (rnrs bytevectors)
  #:use-module (srfi srfi-64))

(define (string->base64 str)
  (base64-encode (string->utf8 str)))

;;; Test vectors from <https://tools.ietf.org/rfc/rfc4648.txt>.

(test-begin "base64")

(test-equal "empty string"
  (string->base64 "")
  "")

(test-equal "f"
  (string->base64 "f")
  "Zg==")

(test-equal "fo"
  (string->base64 "fo")
  "Zm8=")

(test-equal "foo"
  (string->base64 "foo")
  "Zm9v")

(test-equal "foob"
  (string->base64 "foob")
  "Zm9vYg==")

(test-equal "fooba"
  (string->base64 "fooba")
  "Zm9vYmE=")

(test-equal "foobar"
  (string->base64 "foobar")
  "Zm9vYmFy")

(test-end "base64")
glp6278xzsq0gf0xcd-xz-5.0.3-i586-pc-gnu /nix/store/6ikghbgf3s71ar1rswk3zczsj03ca3pn-mig-20100512-i586-pc-gnu /nix/store/3jqfrl6f69h65bmx7yzc1prk64993929-smbfs-2012-03-15-i586-pc-gnu /nix/store/nqscl1nn75353qcr9qq5v7w58c24gj12-unionfs-20120313-i586-pc-gnu /nix/store/kp99qz7whrpfc7jy3ycssr3gvrbdz8ra-gnu-global-user-environment /nix/store/laqpxpssky7v039ga4mvk1c3b36r4gf4-gnumach-20120303-i586-pc-gnu /nix/store/9ypm9rs110msqgb8qykzsxgiab2a6rd7-hurd-0 /nix/store/3jqfrl6f69h65bmx7yzc1prk64993929-smbfs-2012-03-15-i586-pc-gnu/hurd/smbfs -s 10.0.2.4 -r smb://10.0.2.4/xchg -u root -p '' /nix/store/3jqfrl6f69h65bmx7yzc1prk64993929-smbfs-2012-03-15-i586-pc-gnu/hurd/smbfs -s 10.0.2.4 -r smb://10.0.2.4/store -u root -p ''"),("memSize","512"),("name","hurd-qemu-test-build"),("out","/nix/store/yd0v41r8kj49xcjric62gk47lss9vdyg-hurd-qemu-test-build"),("postVM","cp -prvd xchg/out \"$out\"\n"),("preVM","diskImage=$(pwd)/disk-image.qcow2\norigImage=\"/nix/store/2gqgnw6nmh8ksr5l05cqirw3mdcrnf5p-hurd-qemu-image\"\nif test -d \"$origImage\"; then origImage=\"$origImage/disk-image.qcow2\"; fi\n/nix/store/sxczq7kv8265b41yr03s4c41pklyq0ih-qemu-kvm-0.15.1/bin/qemu-img create -b \"$origImage\" -f qcow2 $diskImage\n\n# XXX: Until the guest's /nix/store is a unionfs of its actual\n# store and the host's one (i.e., when both unionfs and smbfs\n# implement `io_map', so that ld.so can load binaries off them),\n# rewrite store paths.\necho \"$buildCommand\" | \\\n /nix/store/w5hacn80b04v1f09nkyypc0sd7bhrknb-gnused-4.2.1/bin/sed -r \\\n -e's|/nix/store/([0-9a-z]{32})-([^ ]+)|/host/store/\\1-\\2|g' \\\n > xchg/cmd\n\neval \"$postPreVM\"\n"),("propagatedBuildInputs",""),("propagatedBuildNativeInputs",""),("requiredSystemFeatures","kvm"),("stdenv","/nix/store/7c8asx3yfrg5dg1gzhzyq2236zfgibnm-stdenv"),("system","x86_64-linux")])