File: md5collisions.sh

package info (click to toggle)
rdfind 1.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 648 kB
  • sloc: cpp: 1,670; sh: 1,622; makefile: 32
file content (26 lines) | stat: -rwxr-xr-x 621 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh
#This just tests basic operation


set -e
. "$(dirname "$0")/common_funcs.sh"

reset_teststate


#check md5 collision files
mkdir md5coll
cp $testscriptsdir/md5collisions/*.ps md5coll
sync

#make sure nothing happens when using sha
$rdfind  -checksum sha1 -deleteduplicates true md5coll 2>&1 |tee rdfind.out
grep -q "^Deleted 0 files.$" rdfind.out
dbgecho "using sha1 did not delete any files, as expected"

$rdfind  -checksum md5 -deleteduplicates true md5coll 2>&1 |tee rdfind.out
grep -q "^Deleted 1 files.$" rdfind.out
dbgecho "using md5 did delete files, as expected"


dbgecho "all is good in this test!"