Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
cl-tar
cl-tar-file
Commits
a8cf320f
Commit
a8cf320f
authored
Aug 15, 2021
by
Eric Timmons
Browse files
Add block and character device tests
parent
c11a9e3a
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/package.lisp
View file @
a8cf320f
...
...
@@ -25,6 +25,8 @@
#:uid
#:gid
#:linkname
#:devmajor
#:devminor
;; entry tests
#:entry-directory-p
...
...
test/gnu.tar
View file @
a8cf320f
No preview for this file type
test/make-test-tars.sh
View file @
a8cf320f
...
...
@@ -2,29 +2,40 @@
DIR
=
"
$(
mktemp
-d
)
"
MTIME
=
"Fri Aug 13 09:05:46.75 PM EDT 2021"
touch_file
()
{
touch
-a
--date
"
Fri Aug 13 09:05:46.75 PM EDT 2021
"
"
$1
"
touch
-a
--date
"
$MTIME
"
"
$1
"
}
touch_files
()
{
touch_file
"
$DIR
/a.txt"
touch_file
"
$DIR
/a-symlink.txt"
touch_file
"
$DIR
/a-hardlink.txt"
sudo touch
-a
--date
"
$MTIME
"
"
$DIR
/sda1"
sudo touch
-a
--date
"
$MTIME
"
"
$DIR
/tty0"
}
echo
"Hello, world!"
>
"
$DIR
/a.txt"
ln
-s
a.txt
"
$DIR
/a-symlink.txt"
ln
"
$DIR
/a.txt"
"
$DIR
/a-hardlink.txt"
sudo mknod
"
$DIR
/sda1"
b 8 1
sudo mknod
"
$DIR
/tty0"
c 4 0
run_tar
()
{
files
=
"a.txt a-symlink.txt a-hardlink.txt"
if
[
"
$1
"
!=
"v7"
]
;
then
files
=
"
$files
sda1 tty0"
fi
tar
-H
"
$1
"
-C
"
$DIR
"
\
--group
=
root
--owner
=
root
\
-b
20
\
--mtime
"Fri Aug 13 09:05:46.5 PM EDT 2021"
\
-cf
"
$1
.tar"
a.txt a-symlink.txt a-hardlink.txt
-cf
"
$1
.tar"
$files
}
ls
-lah
"
$DIR
"
touch_files
run_tar ustar
touch_files
...
...
@@ -34,4 +45,4 @@ run_tar gnu
touch_files
run_tar v7
rm
-rf
"
$DIR
"
sudo
rm
-rf
"
$DIR
"
test/pax.tar
View file @
a8cf320f
No preview for this file type
test/tar.lisp
View file @
a8cf320f
...
...
@@ -49,6 +49,34 @@
(
para:is
=
(
tar:gid
entry
)
0
)
(
para:is
equal
(
tar:linkname
entry
)
"a.txt"
)
;; sda1
(
setf
entry
(
tar:read-entry-from-archive
a
))
(
para:is
equal
(
tar:name
entry
)
"sda1"
)
(
para:is
=
(
tar:size
entry
)
0
)
(
para:is
equal
(
tar:uname
entry
)
"root"
)
(
para:is
equal
(
tar:gname
entry
)
"root"
)
(
para:is
=
(
tar:mode
entry
)
#o644
)
(
para:true
(
tar:entry-block-device-p
entry
))
(
para:is
=
(
tar:mtime
entry
)
1628903146
)
(
para:is
=
(
tar:uid
entry
)
0
)
(
para:is
=
(
tar:gid
entry
)
0
)
(
para:is
=
(
tar:devmajor
entry
)
8
)
(
para:is
=
(
tar:devminor
entry
)
1
)
;; tty0
(
setf
entry
(
tar:read-entry-from-archive
a
))
(
para:is
equal
(
tar:name
entry
)
"tty0"
)
(
para:is
=
(
tar:size
entry
)
0
)
(
para:is
equal
(
tar:uname
entry
)
"root"
)
(
para:is
equal
(
tar:gname
entry
)
"root"
)
(
para:is
=
(
tar:mode
entry
)
#o644
)
(
para:true
(
tar:entry-character-device-p
entry
))
(
para:is
=
(
tar:mtime
entry
)
1628903146
)
(
para:is
=
(
tar:uid
entry
)
0
)
(
para:is
=
(
tar:gid
entry
)
0
)
(
para:is
=
(
tar:devmajor
entry
)
4
)
(
para:is
=
(
tar:devminor
entry
)
0
)
;; End of archive
(
setf
entry
(
tar:read-entry-from-archive
a
))
(
para:true
(
null
entry
)))))
...
...
test/ustar.tar
View file @
a8cf320f
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment