Re: [PATCH net-next v5] net: netconsole: selftests: Create a new netconsole selftest

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jakub Kicinski <kuba@xxxxxxxxxx> writes:

> On Mon, 19 Aug 2024 02:03:53 -0700 Breno Leitao wrote:
>> +function check_for_dependencies() {
>> +	if [ "$(id -u)" -ne 0 ]; then
>> +		echo "This test must be run as root" >&2
>> +		exit "${ksft_skip}"
>> +	fi
>> +
>> +	if ! which socat > /dev/null ; then
>> +		echo "SKIP: socat(1) is not available" >&2
>> +		exit "${ksft_skip}"
>> +	fi
>> +
>> +	if ! which ip > /dev/null ; then
>> +		echo "SKIP: ip(1) is not available" >&2
>> +		exit "${ksft_skip}"
>> +	fi
>> +
>> +	if ! which udevadm > /dev/null ; then
>> +		echo "SKIP: udevadm(1) is not available" >&2
>> +		exit "${ksft_skip}"
>> +	fi
>> +
>> +	if [ ! -d "${NETCONS_CONFIGFS}" ]; then
>> +		echo "SKIP: directory ${NETCONS_CONFIGFS} does not exist. Check if NETCONSOLE_DYNAMIC is enabled" >&2
>> +		exit "${ksft_skip}"
>> +	fi
>> +
>> +	if ip link show "${DSTIF}" 2> /dev/null; then
>> +		echo "SKIP: interface ${DSTIF} exists in the system. Not overwriting it." >&2
>> +		exit "${ksft_skip}"
>> +	fi
>
> nit: maybe ip addr list to see if the 192.168.1.x network is already in
> use? 

Or alternatively use 192.0.2.0/24 subnet, that shouldn't be used in the
wild.




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux