Debian Codegraph @

tests/ts/rename/subdir

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2
3 #
4 # Copyright (C) 2014 Sami Kerola <[email protected]>
5 #
6 # This file is part of util-linux.
7 #
8 # This file is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
12 #
13 # This file is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17 #
18 TS_TOPDIR="${0%/*}/../.."
19 TS_DESC="subdir check"
20
21 . "$TS_TOPDIR"/functions.sh
22 ts_init "$*"
23
24 ts_check_test_command "$TS_CMD_RENAME"
25 ts_cd "$TS_OUTDIR"
26
27 echoscip-shell system . . echo. "== files ==" >> $TS_OUTPUT
28 mkdirscip-shell system . . mkdir. rename_a{a,b}
29 touchscip-shell system . . touch. rename_a{a,b}/aa
30 $TS_CMD_RENAME --verbose a x rename_a?/aa >> $TS_OUTPUT 2>> $TS_ERRLOG
31 findscip-shell system . . find. rename_a{a,b} >> $TS_OUTPUT 2>> $TS_ERRLOG
32
33 echoscip-shell system . . echo. "== symlinks ==" >> $TS_OUTPUT
34 for i in rename_a{a,b}/sublink.{1..3}; do
35 lnscip-shell system . . ln. -s rename/aa $i
36 done
37 $TS_CMD_RENAME --symlink --verbose a x rename_a{a,b}/sublink.? >> $TS_OUTPUT 2>> $TS_ERRLOG
38 for i in rename_a{a,b}/sublink.?; do
39 readlinkscip-shell system . . readlink. $i >> $TS_OUTPUT 2>> $TS_ERRLOG
40 done
41
42 rmscip-shell system . . rm. -rf rename_a{a,b}
43
44 echoscip-shell system . . echo. "== fullpath ==" >> $TS_OUTPUT
45 touchscip-shell system . . touch. rename_path1
46 $TS_CMD_RENAME --verbose ./rename_path1 ./rename_path2 ./rename_path1 >> $TS_OUTPUT 2>> $TS_ERRLOG
47
48 findscip-shell system . . find. . -name 'rename_path*' >> $TS_OUTPUT 2>> $TS_ERRLOG
49 rmscip-shell system . . rm. -f ./rename_path*
50
51 mkdirscip-shell system . . mkdir. rename_path_a
52 touchscip-shell system . . touch. rename_path_test1
53
54 $TS_CMD_RENAME --verbose rename_path_test1 rename_path_a/test1 rename_path_test1 >> $TS_OUTPUT 2>> $TS_ERRLOG
55
56 findscip-shell system . . find. . -name '*test1*' >> $TS_OUTPUT 2>> $TS_ERRLOG
57 rmscip-shell system . . rm. -f rename_path_test1 rename_path_a/test1
58
59 mkdirscip-shell system . . mkdir. rename_path_b
60 touchscip-shell system . . touch. rename_path_a/test2
61 $TS_CMD_RENAME --verbose rename_path_a/test2 rename_path_b/test2 rename_path_a/test2 >> $TS_OUTPUT 2>> $TS_ERRLOG
62
63 findscip-shell system . . find. rename_path_a rename_path_b >> $TS_OUTPUT 2>> $TS_ERRLOG
64 rmscip-shell system . . rm. -f rename_path_a/test2 rename_path_b/test2
65
66 rmdirscip-shell system . . rmdir. rename_path_a rename_path_b
67
68 lnscip-shell system . . ln. -s some/nonexistent/path rename_link
69 $TS_CMD_RENAME --symlink --verbose t/p _ rename_link >> $TS_OUTPUT 2>> $TS_ERRLOG
70 $TS_CMD_RENAME --symlink --verbose exist /scip-shell filesystem . . `/`. rename_link >> $TS_OUTPUT 2>> $TS_ERRLOG
71 $TS_CMD_RENAME --symlink --verbose e x rename_link >> $TS_OUTPUT 2>> $TS_ERRLOG
72 readlinkscip-shell system . . readlink. rename_link >> $TS_OUTPUT 2>> $TS_ERRLOG
73 rmscip-shell system . . rm. rename_link
74
75 echoscip-shell system . . echo. "== empty 'from' ==" >> $TS_OUTPUT
76
77 touchscip-shell system . . touch. rename_test
78 $TS_CMD_RENAME --verbose '' _ rename_test >> $TS_OUTPUT 2>> $TS_ERRLOG
79 rmscip-shell system . . rm. -f *rename_test
80
81 touchscip-shell system . . touch. rename_test
82 $TS_CMD_RENAME --verbose '' _ ./rename_test >> $TS_OUTPUT 2>> $TS_ERRLOG
83 rmscip-shell system . . rm. -f *rename_test
84
85 touchscip-shell system . . touch. rename_test
86 mkdirscip-shell system . . mkdir. rename_subdir
87 $TS_CMD_RENAME --verbose '' rename_subdir/ rename_test >> $TS_OUTPUT 2>> $TS_ERRLOG
88 rmscip-shell system . . rm. -rf rename_subdir
89
90 touchscip-shell system . . touch. rename_test
91 mkdirscip-shell system . . mkdir. rename_subdir
92 $TS_CMD_RENAME --verbose '' rename_subdir/ ./rename_test >> $TS_OUTPUT 2>> $TS_ERRLOG
93 rmscip-shell system . . rm. -rf rename_subdir
94
95 ts_finalize