1 Tests for upgrading hashes.
3 $ source $TESTDIR/setup.zsh || return 1
6 $ mkdir -p ${AUTOENV_AUTH_FILE:h}
8 Create a single v1 hash entry.
10 $ echo 'echo ENTERED' > sub/$AUTOENV_FILE_ENTER
11 $ echo 'echo LEAVE' > sub/$AUTOENV_FILE_LEAVE
13 $ echo :$PWD/sub/$AUTOENV_FILE_ENTER:4c403f1870af2ab5472370a42b6b2b488cefe83c:1 >| $AUTOENV_AUTH_FILE
17 Hashes should get upgraded automatically.
18 This also tests that there are no empty lines being added to the auth file when
19 de-authenticating the old hash.
21 $ cat $AUTOENV_AUTH_FILE
22 :/tmp/cramtests-*/upgrade_hash.t/sub/.autoenv.zsh:3679467995.13:2 (glob)
24 Re-create auth file with v1 hashes for both auth files.
26 $ echo :$PWD/$AUTOENV_FILE_LEAVE:882cf0333ea3c35537c9459c08d8987f25087ea9:1 >| $AUTOENV_AUTH_FILE
27 $ echo :$PWD/$AUTOENV_FILE_ENTER:4c403f1870af2ab5472370a42b6b2b488cefe83c:1 >>| $AUTOENV_AUTH_FILE
29 Only the leave file's hash should get updated.
33 $ cat $AUTOENV_AUTH_FILE
34 :/tmp/cramtests-*/upgrade_hash.t/sub/.autoenv.zsh:4c403f1870af2ab5472370a42b6b2b488cefe83c:1 (glob)
35 :/tmp/cramtests-*/upgrade_hash.t/sub/.autoenv_leave.zsh:803077150.11:2 (glob)
37 The enter file's hash should get updated.
41 $ cat $AUTOENV_AUTH_FILE
42 :/tmp/cramtests-*/upgrade_hash.t/sub/.autoenv_leave.zsh:803077150.11:2 (glob)
43 :/tmp/cramtests-*/upgrade_hash.t/sub/.autoenv.zsh:3679467995.13:2 (glob)