]> arthur.barton.de Git - bup.git/blobdiff - t/test-ls.sh
CONTRIBUTING: rename to CONTRIBUTING.md for link
[bup.git] / t / test-ls.sh
index 15b5ac86046905e5150feca40fed1ba4bac7f621..5d8fda86b4c8face2b6248d38d3c943e0a89684e 100755 (executable)
@@ -1,5 +1,6 @@
 #!/usr/bin/env bash
-. ./wvtest-bup.sh
+. ./wvtest-bup.sh || exit $?
+. t/lib.sh || exit $?
 
 set -o pipefail
 
@@ -17,26 +18,25 @@ WVPASS bup init
 WVPASS cd "$tmpdir"
 
 WVPASS mkdir src
-WVPASS touch -t 196907202018 src/.dotfile
-WVPASS bup random 1k > src/file
-WVPASS touch -t 196907202018 src/file
-(WVPASS cd src; WVPASS ln -s file symlink) || exit $?
+WVPASS touch src/.dotfile src/executable
 WVPASS mkfifo src/fifo
-WVPASS touch -t 196907202018 src/fifo
 WVPASS "$top"/t/mksock src/socket
-WVPASS touch -t 196907202018 src/socket
-WVPASS touch -t 196907202018 src/executable
+WVPASS bup random 1k > src/file
 WVPASS chmod u+x src/executable
-WVPASS touch -t 196907202018 src/executable
+WVPASS chmod -R u=rwX,g-rwx,o-rwx .
+WVPASS touch -t 196907202018 src/.dotfile src/*
+(WVPASS cd src; WVPASS ln -s file symlink) || exit $?
 WVPASS touch -t 196907202018 src
 WVPASS touch -t 196907202018 .
-WVPASS chmod -R u=rwX,g-rwx,o-rwx .
 WVPASS bup index src
-WVPASS bup save -n src src
+WVPASS bup save -n src -d 242312160 src
+WVPASS bup tag some-tag src
 
 
 WVSTART "ls (short)"
 
+(export BUP_FORCE_TTY=1; WVPASSEQ "$(WVPASS bup ls | tr -d ' ')" src)
+
 WVPASSEQ "$(WVPASS bup ls /)" "src"
 
 WVPASSEQ "$(WVPASS bup ls -A /)" ".commit
@@ -59,6 +59,12 @@ WVPASSEQ "$(WVPASS bup ls -aF /)" "./
 .tag/
 src/"
 
+WVPASSEQ "$(WVPASS bup ls /.tag)" "some-tag"
+
+WVPASSEQ "$(WVPASS bup ls /src)" \
+"1977-09-05-125600
+latest"
+
 WVPASSEQ "$(WVPASS bup ls src/latest/"$tmpdir"/src)" "executable
 fifo
 file
@@ -134,7 +140,7 @@ symlink_date="$(WVPASS echo "$symlink_bup_info" \
     || exit $?
 
 if test "$(uname -s)" != NetBSD; then
-    symlink_size="$(WVPASS python -c "import os
+    symlink_size="$(WVPASS bup-python -c "import os
 print os.lstat('src/symlink').st_size")" || exit $?
 else
     # NetBSD appears to return varying sizes, so for now, just ignore it.
@@ -143,10 +149,10 @@ else
         || exit $?
 fi
 
-uid="$(id -u)" || exit $?
-gid="$(python -c 'import os; print os.stat("src").st_gid')" || exit $?
-user="$(id -un)" || exit $?
-group="$(python -c 'import grp, os;
+uid="$(WVPASS id -u)" || exit $?
+gid="$(WVPASS bup-python -c 'import os; print os.stat("src").st_gid')" || exit $?
+user="$(WVPASS id -un)" || exit $?
+group="$(WVPASS bup-python -c 'import grp, os;
 print grp.getgrgid(os.stat("src").st_gid)[0]')" || exit $?
 
 WVPASSEQ "$(bup ls -l src/latest"$tmpdir"/src | tr -s ' ' ' ')" \
@@ -206,7 +212,7 @@ l--------- ?/?"
 
 
 WVSTART "ls (dates TZ != UTC)"
-export TZ=US/Central
+export TZ=America/Chicago
 symlink_date_central="$(bup ls -l src/latest"$tmpdir"/src | grep symlink)"
 symlink_date_central="$(echo "$symlink_date_central" \
   | perl -ne 'm/.*? (\d+) (\d\d\d\d-\d\d-\d\d \d\d:\d\d)/ and print $2')"