Skip to content

Commit d1ea929

Browse files
cryptomilkanoopcs9
authored andcommitted
tests: Run dd without any preloaded libraries
If AddressSanitizer is loaded it will detect alignment issues. The tool is not ours, so ignore it. Signed-off-by: Andreas Schneider <[email protected]> Reviewed-by: Anoop C S <[email protected]> Autobuild-User(master): Anoop C S <[email protected]> Autobuild-Date(master): Thu Oct 16 09:34:58 UTC 2025 on atb-devel-224
1 parent b989f6e commit d1ea929

File tree

11 files changed

+18
-15
lines changed

11 files changed

+18
-15
lines changed

source3/script/tests/test_smbclient_large_file.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ EOF
4949
}
5050

5151
rm -f $PREFIX/largefile
52-
dd if=/dev/zero of=$PREFIX/largefile seek=$((20 * 1024 * 1024)) count=1 bs=1
52+
LD_PRELOAD='' dd if=/dev/zero of=$PREFIX/largefile seek=$((20 * 1024 * 1024)) count=1 bs=1
5353

5454
incdir=$(dirname $0)/../../../testprogs/blackbox
5555
. $incdir/subunit.sh

source3/script/tests/test_smbclient_tarmode.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ create_test_data()
5858
if have_command "od"; then # Use random file sizes
5959
local RND_COUNT
6060
for RND_COUNT in $(od -An -N$NUM_FILES -tu1 </dev/urandom); do
61-
if ! dd if=/dev/urandom of="$DIR/file.$I" bs=$BS count=$RND_COUNT >/dev/null 2>&1; then
61+
if ! LD_PRELOAD='' dd if=/dev/urandom of="$DIR/file.$I" bs=$BS count=$RND_COUNT >/dev/null 2>&1; then
6262
echo "Couldn't create test file '$DIR/file.$I' (random size)"
6363
false
6464
return
@@ -67,7 +67,7 @@ create_test_data()
6767
done
6868
else # Fallback to same file sizes
6969
while [ $I -le $NUM_FILES ]; do
70-
if ! dd if=/dev/urandom of="$DIR/file.$I" bs=$BS count=$NORND_COUNT >/dev/null 2>&1; then
70+
if ! LD_PRELOAD='' dd if=/dev/urandom of="$DIR/file.$I" bs=$BS count=$NORND_COUNT >/dev/null 2>&1; then
7171
echo "Couldn't create test file '$DIR/file.$I' (static size)"
7272
false
7373
return

source3/script/tests/test_smbget.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ samba_texpect="${BINDIR}/texpect"
3434
create_test_data()
3535
{
3636
pushd $WORKDIR
37-
dd if=/dev/urandom bs=1024 count=128 of=testfile
37+
# Do not preload anything for dd
38+
LD_PRELOAD='' dd if=/dev/urandom bs=1024 count=128 of=testfile
3839
chmod 644 testfile
3940
mkdir dir1
40-
dd if=/dev/urandom bs=1024 count=128 of=dir1/testfile1
41+
LD_PRELOAD='' dd if=/dev/urandom bs=1024 count=128 of=dir1/testfile1
4142
mkdir dir2
42-
dd if=/dev/urandom bs=1024 count=128 of=dir2/testfile2
43+
LD_PRELOAD='' dd if=/dev/urandom bs=1024 count=128 of=dir2/testfile2
4344
popd
4445
}
4546

@@ -308,7 +309,8 @@ test_resume()
308309
test_resume_modified()
309310
{
310311
clear_download_area
311-
dd if=/dev/urandom bs=1024 count=2 of=testfile
312+
# Do not preload anything for dd
313+
LD_PRELOAD='' dd if=/dev/urandom bs=1024 count=2 of=testfile
312314
$SMBGET --verbose --resume -U${SERVER}/${USERNAME}%$PASSWORD smb://$SERVER_IP/smbget/testfile
313315
if [ $? -ne 1 ]; then
314316
echo 'ERROR: RC does not match, expected: 1'

source3/script/tests/test_zero_data.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ TESTDIR=$LOCAL_PATH/zero_data
2626
mkdir -p $TESTDIR
2727
chmod 777 p $TESTDIR
2828

29-
dd if=/dev/urandom of=$TESTDIR/testfile bs=1024 count=128
29+
# Do not preload anything for dd
30+
LD_PRELOAD='' dd if=/dev/urandom of=$TESTDIR/testfile bs=1024 count=128
3031
chmod 777 $TESTDIR/testfile
3132

3233
alloc_kb=$(du -k $TESTDIR/testfile | sed -e 's/\t.*//')

source3/script/tests/test_zero_readsize.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ do_setup()
4040
{
4141
rm -f "${PREFIX}/zero_read_testfile"
4242
rm -f "${PREFIX}/zero_read_testfile_get"
43-
dd if=/dev/zero of="${PREFIX}/zero_read_testfile" bs=1024 count=1
43+
LD_PRELOAD='' dd if=/dev/zero of="${PREFIX}/zero_read_testfile" bs=1024 count=1
4444
global_inject_conf="$(dirname "${SERVERCONFFILE}")/global_inject.conf"
4545
echo "smb2 max read = 0" >"$global_inject_conf"
4646
${SMBCONTROL} ${CONF} smbd reload-config

source4/client/tests/test_cifsdd.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ destfile=tempfile.dst.$$
4242
destpath=${SELFTEST_TMPDIR}/$destfile
4343

4444
# Create a source file with arbitrary contents
45-
dd if=$DD of=$sourcepath bs=1024 count=50 >/dev/null
45+
LD_PRELOAD='' dd if=$DD of=$sourcepath bs=1024 count=50 >/dev/null
4646

4747
ls -l $sourcepath
4848

testprogs/blackbox/test_client_etypes.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ EOF
3030
exit 0
3131
fi
3232

33-
HOSTNAME=$(dd if=/dev/urandom bs=1 count=32 2>/dev/null | sha1sum | cut -b 1-10)
33+
HOSTNAME=$(LD_PRELOAD='' dd if=/dev/urandom bs=1 count=32 2>/dev/null | sha1sum | cut -b 1-10)
3434

3535
RUNDIR=$(pwd)
3636
cd $BASEDIR

testprogs/blackbox/test_net_ads.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ DC_USERNAME=$2
1010
DC_PASSWORD=$3
1111
BASEDIR=$4
1212

13-
HOSTNAME=$(dd if=/dev/urandom bs=1 count=32 2>/dev/null | sha1sum | cut -b 1-10)
13+
HOSTNAME=$(LD_PRELOAD='' dd if=/dev/urandom bs=1 count=32 2>/dev/null | sha1sum | cut -b 1-10)
1414

1515
RUNDIR=$(pwd)
1616
cd $BASEDIR

testprogs/blackbox/test_net_ads_fips.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ DC_USERNAME=$2
1010
DC_PASSWORD=$3
1111
BASEDIR=$4
1212

13-
HOSTNAME=$(dd if=/dev/urandom bs=1 count=32 2>/dev/null | sha1sum | cut -b 1-10)
13+
HOSTNAME=$(LD_PRELOAD='' dd if=/dev/urandom bs=1 count=32 2>/dev/null | sha1sum | cut -b 1-10)
1414

1515
RUNDIR=$(pwd)
1616
cd $BASEDIR

testprogs/blackbox/test_net_ads_join_to_preferred_dc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ DC_USERNAME=$2
1010
DC_PASSWORD=$3
1111
BASEDIR=$4
1212

13-
HOSTNAME=$(dd if=/dev/urandom bs=1 count=32 2>/dev/null | sha1sum | cut -b 1-10)
13+
HOSTNAME=$(LD_PRELOAD='' dd if=/dev/urandom bs=1 count=32 2>/dev/null | sha1sum | cut -b 1-10)
1414

1515
RUNDIR=$(pwd)
1616
cd $BASEDIR

0 commit comments

Comments
 (0)