locktest: command not found

Have You tried accessing the binary with the full path?

Maybe Your $PATH variable doesn't contain the default paths? echo $PATH should give something like:

[root@server ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

If it's empty, You may set the PATH variable with this command

export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"

On CentOS possible default full paths are:

/usr/bin/locktest - from package: samba4-test

You may install the required package with command yum install {package}

On Debian possible default full paths are:

/usr/bin/locktest - from package: samba-testsuite

You may install the required package with command apt-get install {package}
Error in other languages:
locktest: bevel nie gevind nie
locktest: comandă negăsită
locktest: comando não encontrado
locktest: commande introuvable
locktest: command not found
locktest: käsku ei ole
locktest: không tìm thấy lệnh
locktest: komanda nerasta
locktest: Kommando nicht gefunden.
locktest: kommandot finns inte
locktest: komut yok
locktest: nie znaleziono polecenia
locktest: níor aimsíodh an t-ordú
locktest: no se encontró la orden
locktest: no s'ha trobat l'ordre
locktest: opdracht niet gevonden
locktest: parancs nem található
locktest: perintah tidak ditemukan
locktest: príkaz nenájdený
locktest: příkaz nenalezen
locktest: команда не найдена
locktest: командата не е открита
locktest: 命令找不到
locktest: コマンドが見つかりません