]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tests: Run `dd` without any preloaded libraries
authorAndreas Schneider <asn@samba.org>
Tue, 14 Oct 2025 09:57:04 +0000 (11:57 +0200)
committerAnoop C S <anoopcs@samba.org>
Thu, 16 Oct 2025 09:34:58 +0000 (09:34 +0000)
If AddressSanitizer is loaded it will detect alignment issues. The tool
is not ours, so ignore it.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Thu Oct 16 09:34:58 UTC 2025 on atb-devel-224

source3/script/tests/test_smbclient_large_file.sh
source3/script/tests/test_smbclient_tarmode.sh
source3/script/tests/test_smbget.sh
source3/script/tests/test_zero_data.sh
source3/script/tests/test_zero_readsize.sh
source4/client/tests/test_cifsdd.sh
testprogs/blackbox/test_client_etypes.sh
testprogs/blackbox/test_net_ads.sh
testprogs/blackbox/test_net_ads_fips.sh
testprogs/blackbox/test_net_ads_join_to_preferred_dc.sh
testprogs/blackbox/test_net_offline.sh

index 80816bec10c5e7a70c51187e348d3961fac222e7..3a384e2c1ba156b69a8cd2411f025d9c44f65aff 100755 (executable)
@@ -49,7 +49,7 @@ EOF
 }
 
 rm -f $PREFIX/largefile
-dd if=/dev/zero of=$PREFIX/largefile seek=$((20 * 1024 * 1024)) count=1 bs=1
+LD_PRELOAD='' dd if=/dev/zero of=$PREFIX/largefile seek=$((20 * 1024 * 1024)) count=1 bs=1
 
 incdir=$(dirname $0)/../../../testprogs/blackbox
 . $incdir/subunit.sh
index d48e4120f7d49e57695f619c2c7155bf9df969f8..555c0d6980ae8bb8802558e2e581b2cee34e1acd 100755 (executable)
@@ -58,7 +58,7 @@ create_test_data()
        if have_command "od"; then # Use random file sizes
                local RND_COUNT
                for RND_COUNT in $(od -An -N$NUM_FILES -tu1 </dev/urandom); do
-                       if ! dd if=/dev/urandom of="$DIR/file.$I" bs=$BS count=$RND_COUNT >/dev/null 2>&1; then
+                       if ! LD_PRELOAD='' dd if=/dev/urandom of="$DIR/file.$I" bs=$BS count=$RND_COUNT >/dev/null 2>&1; then
                                echo "Couldn't create test file '$DIR/file.$I' (random size)"
                                false
                                return
@@ -67,7 +67,7 @@ create_test_data()
                done
        else # Fallback to same file sizes
                while [ $I -le $NUM_FILES ]; do
-                       if ! dd if=/dev/urandom of="$DIR/file.$I" bs=$BS count=$NORND_COUNT >/dev/null 2>&1; then
+                       if ! LD_PRELOAD='' dd if=/dev/urandom of="$DIR/file.$I" bs=$BS count=$NORND_COUNT >/dev/null 2>&1; then
                                echo "Couldn't create test file '$DIR/file.$I' (static size)"
                                false
                                return
index 8f8513d5b62779f18090a30dc4b2b0c4e61a93b7..b8e6200fbe1f01e7b39ef7a5a4e67d619ad7af4c 100755 (executable)
@@ -34,12 +34,13 @@ samba_texpect="${BINDIR}/texpect"
 create_test_data()
 {
        pushd $WORKDIR
-       dd if=/dev/urandom bs=1024 count=128 of=testfile
+       # Do not preload anything for dd
+       LD_PRELOAD='' dd if=/dev/urandom bs=1024 count=128 of=testfile
        chmod 644 testfile
        mkdir dir1
-       dd if=/dev/urandom bs=1024 count=128 of=dir1/testfile1
+       LD_PRELOAD='' dd if=/dev/urandom bs=1024 count=128 of=dir1/testfile1
        mkdir dir2
-       dd if=/dev/urandom bs=1024 count=128 of=dir2/testfile2
+       LD_PRELOAD='' dd if=/dev/urandom bs=1024 count=128 of=dir2/testfile2
        popd
 }
 
@@ -308,7 +309,8 @@ test_resume()
 test_resume_modified()
 {
        clear_download_area
-       dd if=/dev/urandom bs=1024 count=2 of=testfile
+       # Do not preload anything for dd
+       LD_PRELOAD='' dd if=/dev/urandom bs=1024 count=2 of=testfile
        $SMBGET --verbose --resume -U${SERVER}/${USERNAME}%$PASSWORD smb://$SERVER_IP/smbget/testfile
        if [ $? -ne 1 ]; then
                echo 'ERROR: RC does not match, expected: 1'
index 62ba856f34d6a8b519c12134d3ac5e2c1b47852f..fd224cc48c4d169126400da58c35e0ecfaf982b4 100755 (executable)
@@ -26,7 +26,8 @@ TESTDIR=$LOCAL_PATH/zero_data
 mkdir -p $TESTDIR
 chmod 777 p $TESTDIR
 
-dd if=/dev/urandom of=$TESTDIR/testfile bs=1024 count=128
+# Do not preload anything for dd
+LD_PRELOAD='' dd if=/dev/urandom of=$TESTDIR/testfile bs=1024 count=128
 chmod 777 $TESTDIR/testfile
 
 alloc_kb=$(du -k $TESTDIR/testfile | sed -e 's/\t.*//')
index f859599ba89444a6992bd512df6671ede29b6f9d..18866ed6929c62f231d1f1d25f61fbec6b64919e 100755 (executable)
@@ -40,7 +40,7 @@ do_setup()
 {
        rm -f "${PREFIX}/zero_read_testfile"
        rm -f "${PREFIX}/zero_read_testfile_get"
-       dd if=/dev/zero of="${PREFIX}/zero_read_testfile" bs=1024 count=1
+       LD_PRELOAD='' dd if=/dev/zero of="${PREFIX}/zero_read_testfile" bs=1024 count=1
        global_inject_conf="$(dirname "${SERVERCONFFILE}")/global_inject.conf"
        echo "smb2 max read = 0" >"$global_inject_conf"
        ${SMBCONTROL} ${CONF} smbd reload-config
index 21a884061bff8c8250bcd4296e22127f68e3be8d..80575042c630c2e100c22379da5676fca68cff5c 100755 (executable)
@@ -42,7 +42,7 @@ destfile=tempfile.dst.$$
 destpath=${SELFTEST_TMPDIR}/$destfile
 
 # Create a source file with arbitrary contents
-dd if=$DD of=$sourcepath bs=1024 count=50 >/dev/null
+LD_PRELOAD='' dd if=$DD of=$sourcepath bs=1024 count=50 >/dev/null
 
 ls -l $sourcepath
 
index 88f47199cbd13124a2620a1ce06e5550c4437196..0e86ebec8b21b4f3548144b29b5016a386339d0f 100755 (executable)
@@ -30,7 +30,7 @@ EOF
        exit 0
 fi
 
-HOSTNAME=$(dd if=/dev/urandom bs=1 count=32 2>/dev/null | sha1sum | cut -b 1-10)
+HOSTNAME=$(LD_PRELOAD='' dd if=/dev/urandom bs=1 count=32 2>/dev/null | sha1sum | cut -b 1-10)
 
 RUNDIR=$(pwd)
 cd $BASEDIR
index 5340056cc3e83961f4dbcc9e0a6e00df6ceecdae..c12c8318bbd0e28c41e33a11e1529c76ccdc4f5f 100755 (executable)
@@ -10,7 +10,7 @@ DC_USERNAME=$2
 DC_PASSWORD=$3
 BASEDIR=$4
 
-HOSTNAME=$(dd if=/dev/urandom bs=1 count=32 2>/dev/null | sha1sum | cut -b 1-10)
+HOSTNAME=$(LD_PRELOAD='' dd if=/dev/urandom bs=1 count=32 2>/dev/null | sha1sum | cut -b 1-10)
 
 RUNDIR=$(pwd)
 cd $BASEDIR
index cbadc514139dedd8f7f5cf4d0eb45732ea7dbae8..b19580b90029079007af8393f4621d281073265d 100755 (executable)
@@ -10,7 +10,7 @@ DC_USERNAME=$2
 DC_PASSWORD=$3
 BASEDIR=$4
 
-HOSTNAME=$(dd if=/dev/urandom bs=1 count=32 2>/dev/null | sha1sum | cut -b 1-10)
+HOSTNAME=$(LD_PRELOAD='' dd if=/dev/urandom bs=1 count=32 2>/dev/null | sha1sum | cut -b 1-10)
 
 RUNDIR=$(pwd)
 cd $BASEDIR
index 1bebc2f4dbe6bc154c4ec85f71f4d33aecd55c02..129836c50dd85ba53e7d2c08d30c03a3e878f0f6 100755 (executable)
@@ -10,7 +10,7 @@ DC_USERNAME=$2
 DC_PASSWORD=$3
 BASEDIR=$4
 
-HOSTNAME=$(dd if=/dev/urandom bs=1 count=32 2>/dev/null | sha1sum | cut -b 1-10)
+HOSTNAME=$(LD_PRELOAD='' dd if=/dev/urandom bs=1 count=32 2>/dev/null | sha1sum | cut -b 1-10)
 
 RUNDIR=$(pwd)
 cd $BASEDIR
index df0c73fa21c111cf475447d2be92f3eb88484d82..a62963a695bf2c5847012c52f4cbe0a9cfd60cc8 100755 (executable)
@@ -10,7 +10,7 @@ DC_USERNAME=$2
 DC_PASSWORD=$3
 BASEDIR=$4
 
-HOSTNAME=$(dd if=/dev/urandom bs=1 count=32 2>/dev/null | sha1sum | cut -b 1-10)
+HOSTNAME=$(LD_PRELOAD='' dd if=/dev/urandom bs=1 count=32 2>/dev/null | sha1sum | cut -b 1-10)
 
 RUNDIR=$(pwd)
 cd $BASEDIR