logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git

mv-devshm.t (844B)


  1. #!/usr/bin/env cram
  2. # SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  3. # SPDX-License-Identifier: MPL-2.0
  4. $ export PATH="$TESTDIR/../cmd:$PATH"
  5. $ test "$(command -v mv)" = "$TESTDIR/../cmd/mv"
  6. Skip if /dev/shm doesn't exists
  7. $ test -d /dev/shm || exit 80
  8. Successfully moves directory contents accross filesystems
  9. $ mkdir non-empty-dir
  10. $ touch non-empty-dir/foo
  11. $ mkdir non-empty-dir/foo.d
  12. $ touch non-empty-dir/foo.d/bar
  13. $ test -f non-empty-dir/foo
  14. $ test -f non-empty-dir/foo.d/bar
  15. $ rm -f /dev/shm/mv-test-non-empty-dir
  16. $ mv non-empty-dir /dev/shm/mv-test-non-empty-dir
  17. $ test -f /dev/shm/mv-test-non-empty-dir/foo
  18. $ test -f /dev/shm/mv-test-non-empty-dir/foo.d/bar
  19. $ test ! -e non-empty-dir
  20. $ rm -fr /dev/shm/mv-test-non-empty-dir
  21. No files should be left
  22. $ find .
  23. .