From patchwork Thu Aug 15 10:59:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhinav Jain X-Patchwork-Id: 13764654 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-oa1-f41.google.com (mail-oa1-f41.google.com [209.85.160.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F1DF31AC894; Thu, 15 Aug 2024 10:59:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723719584; cv=none; b=Now7brFzZJNxcB9N5/I9A2o5GSc2tLxZloQa1v15Dqsk8Fp+z4AqVnSLW+Gf2cn3K8kBxx2vQSGFAkzYdcKrNHsP56mJ+ul/nRRpHlOnGgcGXZSVN5SlTuBsj4oO/UJ24jERg3tyyJoaM9vxZkBq5Tp8LbKI3443dD8joFphqzs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723719584; c=relaxed/simple; bh=BEOj7P4xJeFSnOj0Ju6Rm9KsxDM/MTPYKwQ7Ti+PJ1w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=chagRu6Uw+ad81StZ7DYn9qTmkhkPy4hiv4Op0da2NG3mDzkIEmRsijytRuXBdCoN0QUpGyf8/nrj0yy3F7xNhUp1T51ZL286dO9u1i3WKqACakFXpAYd1Z2x6ZJNOHhZavz+mH+13x1DSOZ0B9GyDCBH254KTLWXMVLJlWwTLo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=T+kIJbZR; arc=none smtp.client-ip=209.85.160.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="T+kIJbZR" Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-26ff21d82e4so473292fac.2; Thu, 15 Aug 2024 03:59:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723719582; x=1724324382; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=A2r9/EW3jCvQa7Bv9foKbr5PU4TW2LXHUdYb6h2YrHw=; b=T+kIJbZRvDA5xU39Cgug99NbgWaAtJkbQq8M+vbYL7rDaMLVfr8IL+ffcX3XUFJtRG Tmd3hrFne9pDOUnEsN9LwQyiItFdBC3alhbmuBUTBC91AqDlupKuQS20fRO+x8CAfwKL 8svsL9u3ymutcOHljfHahEfT4r46xnLA6RE2Zn8i6pHFWYRmYIaoIEJjV5I+QdalICSr D6XgodcxUJZjqg0y+l9NmzkOw+eLXfk9UkUFXoLWwmBZOitJGuDce1PnwOoYQxrF0H7m Akx7J4qUv4klvkKnm0OSnDvRB/8LwwFMD1QnvZXfElHPUvbqxT0O4N//EWXPoueuif7n iI1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723719582; x=1724324382; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=A2r9/EW3jCvQa7Bv9foKbr5PU4TW2LXHUdYb6h2YrHw=; b=BKvf07fNkAV3SJgyIZVaRRxBDYu6bVl/7nTd6f5k5vLOQqu3d+TKOHOphCNKak41A7 g/JYueEyumma3ZC2HiwIDJEGpv27lao804QSEkxC/xtz8YQjxtdPS/6FaOFzV4QMtLkQ GpPxrSchlSrvRcDjNP7FMrqbtlwYs80xVCoIDkQNiP/5kOxG5xJ91wV5UgD9dTWc/bhL 5ULD74Db7irfaISEEovePXq+dv2wlAfT/YMAEzQJCmqm572TO/YWOofdnyImnlo/gOt7 bl4N339kmvKkN7HOh+1PKfadXtQ73L+h6ljF0IaMs+WqNHay3Obfq/f2mprUdncveBoC SKmg== X-Forwarded-Encrypted: i=1; AJvYcCXGjRiVsfaIq0DXhYGHweEHESokw32v4V5r0NDg5rDwQQJi73dLd70IPEvhYAwqXEitnDeJ3W+Bfk3LzL8fvY1z4AjSecLECvg7zOR8Wgl/q+OmIg8KsnybW0fRbg9Y0C3QmL40gIHQShInJi0F7UENvGkE0TsFPcsqf12Cm6wAzYb9Y/CT X-Gm-Message-State: AOJu0YyS/Qqv6Tx1qLFpiSGi5NiS0+t+/R/NRyKSDVfWuEy3pK/WdANj pXQDF4jIlmuKVtAicfgbJdiFcD9ugR8C6wxdilp+2clccjdBg+5J X-Google-Smtp-Source: AGHT+IGirFlaXoXP71zo21mJ21H4TWzYTBbM5uIkHexbqAUsQWsbNuX/y8HpZaz0jsPUU6P9sUpnzQ== X-Received: by 2002:a05:6870:7029:b0:260:e6a6:396c with SMTP id 586e51a60fabf-26fe5b0d4d7mr6646453fac.30.1723719581355; Thu, 15 Aug 2024 03:59:41 -0700 (PDT) Received: from dev0.. ([2405:201:6803:30b3:f070:7306:329d:c8ca]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7127ae6c76fsm829915b3a.94.2024.08.15.03.59.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 03:59:41 -0700 (PDT) From: Abhinav Jain To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, shuah@kernel.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: skhan@linuxfoundation.org, javier.carrasco.cruz@gmail.com, Abhinav Jain Subject: [PATCH v7 net-next 1/3] selftests: net: Create veth pair for testing in networkless kernel Date: Thu, 15 Aug 2024 16:29:22 +0530 Message-Id: <20240815105924.1389290-2-jain.abhinav177@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240815105924.1389290-1-jain.abhinav177@gmail.com> References: <20240815105924.1389290-1-jain.abhinav177@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Check if the netdev list is empty and create veth pair to be used for feature on/off testing. Remove the veth pair after testing is complete. Signed-off-by: Abhinav Jain --- tools/testing/selftests/net/netdevice.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tools/testing/selftests/net/netdevice.sh b/tools/testing/selftests/net/netdevice.sh index e3afcb424710..0c32950fdd17 100755 --- a/tools/testing/selftests/net/netdevice.sh +++ b/tools/testing/selftests/net/netdevice.sh @@ -129,6 +129,7 @@ kci_netdev_ethtool() kci_netdev_ethtool_test 74 'dump' "ethtool -d $netdev" kci_netdev_ethtool_test 94 'stats' "ethtool -S $netdev" + return 0 } @@ -196,10 +197,25 @@ if [ ! -e "$TMP_LIST_NETDEV" ];then fi ip link show |grep '^[0-9]' | grep -oE '[[:space:]].*eth[0-9]*:|[[:space:]].*enp[0-9]s[0-9]:' | cut -d\ -f2 | cut -d: -f1> "$TMP_LIST_NETDEV" + +if [ ! -s "$TMP_LIST_NETDEV" ]; then + echo "No valid network device found, creating veth pair" + ip link add veth0 type veth peer name veth1 + echo "veth0" > "$TMP_LIST_NETDEV" + echo "veth1" >> "$TMP_LIST_NETDEV" + veth_created=1 +fi + while read netdev do kci_test_netdev "$netdev" done < "$TMP_LIST_NETDEV" +#clean up veth interface pair if it was created +if [ "$veth_created" ]; then + ip link delete veth0 + echo "Removed veth pair" +fi + rm "$TMP_LIST_NETDEV" exit 0 From patchwork Thu Aug 15 10:59:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhinav Jain X-Patchwork-Id: 13764655 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C42411AC89A; Thu, 15 Aug 2024 10:59:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723719590; cv=none; b=PWf/4/iV13v7mWzphfv0ltzPkmkSyKIRwB+zI29WmHW7quSZBykNDIetHrr8MbDNo6r284KBqpRSdg5ufTWKULWHGmjXVlx61mvP/ywMcwpV1+20sLr3TGrc3RM6aMlY8nSPi//00y4xPL9EFTlYgqGUu0o4OrXq0PWcz1tSdjM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723719590; c=relaxed/simple; bh=jtalaf4i0vBrVvnWmgxU3qfha27p3Pcpv6SHl8PIUGQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XwADcKJEZDBv3aWLM/l2GMPxlW5TYGvTTcf4yCkA+oNSTqKeIdPyYpzhUkGF6NmNHFK1BKLDaGP6Yr8XcbrVixs0jUC9NzVK6nMw8G/iiWbNI9Q9+OmKVpPHAXRIwVsWUOsZtGnDQxXZt9iAJVOXZie0fuemAEoxIEHOykMLAVY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=A4D7asOH; arc=none smtp.client-ip=209.85.167.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="A4D7asOH" Received: by mail-oi1-f169.google.com with SMTP id 5614622812f47-3db23a60850so489392b6e.0; Thu, 15 Aug 2024 03:59:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723719588; x=1724324388; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SEXn+6uaDaibQ3LCSAfL1ofGJtzehJXz9fPnsXVCy5U=; b=A4D7asOHupG09QwqOxU1ZeHs1qZIRXhpRkuX9h6kc9tEnULQP8Q/BrX8XkHIQdsh+4 DwyaAnaUCefoRFseOW1YimszjfSZUc5FtjAuaKQhoLWr/dwvTfKX/5tVeDW6y7fEV2di PVEuFIBGzT0vbYN51ein09qqww99SYz1IoT4tDujBLgSATy4UwdN9+89MYyYmAlr7TV4 sQG7X7MD04y1Hjok36NbmHg6HtSphQmD6HURMeLMDB092GB6vYlp2zFEMXevsz5mmbRd 5pqg2X5/cIKmI71MJcINbIS3jEg4jST8wVhoD607w9u+w6pW9r57ZqFnifsqWWb8Ib3W LMDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723719588; x=1724324388; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SEXn+6uaDaibQ3LCSAfL1ofGJtzehJXz9fPnsXVCy5U=; b=g88TYH6nPCoTkYXlXGSdaM/DpGRLw7//Tuxbi188fBMjIqsqsRimRdF3feF2Uce9q3 ki9Nn4Tfr8DcizBr2TrUnJZUzoF76BSrqRV9HLmHJxkqjmA7W/FGgRUDdlbXPOm8h2JS boUONRjJjHOkKbVaXuq8Cmt5ARIbkiaoCsHg2tktBMqrOqMzedLEOHEWz1m5WBURcgQO GwRfZafLakoGkuOIF7cstuxm1s4bBIUAiLag4CpHvy7sgMh2E1wf91A9RTeDgd3S6j+i 0eSt1Nrlmj7KpUwgquBGMUtmkholnxEkPnnVgkRInEVwqxpbPnou9W8hUfNtskb9k3ax rZnw== X-Forwarded-Encrypted: i=1; AJvYcCVlpH3IiBo8ZxLr/4imI7Y02qhE0nRlK68+YRQij1shig2CpRMORvUuJibEY/V7jx7FSTlls0+PYGiFXhHOuque55R/BSH4w4qPLGLO0CJJ2eeA48PBz2bF3DNClJvvRjjne58Ri+Fs3IgUF6bfW2j5D9oLqK4KqWjHGY8BsPMMp/Kwt+3W X-Gm-Message-State: AOJu0YzkuebxA68C0kC+cQC85RviUUWBMeBycBrYGxJI3dL9vxu1V80y U7W1IBe1cE7JXtvxURFD4qKpc5Rg8ybBndPeNxIBcGb9MhLNSvbj X-Google-Smtp-Source: AGHT+IHsRd4NalhaB6IlCGdqhEueKN+5uOe1kSJDF/52TbNUgbDCpKuWdsm1SucgNabrpAQXIY1HoQ== X-Received: by 2002:a05:6870:b6a0:b0:25e:14f0:62b1 with SMTP id 586e51a60fabf-26fe5a63926mr7083078fac.13.1723719587691; Thu, 15 Aug 2024 03:59:47 -0700 (PDT) Received: from dev0.. ([2405:201:6803:30b3:f070:7306:329d:c8ca]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7127ae6c76fsm829915b3a.94.2024.08.15.03.59.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 03:59:47 -0700 (PDT) From: Abhinav Jain To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, shuah@kernel.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: skhan@linuxfoundation.org, javier.carrasco.cruz@gmail.com, Abhinav Jain Subject: [PATCH v7 net-next 2/3] selftests: net: Add on/off checks for non-fixed features of interface Date: Thu, 15 Aug 2024 16:29:23 +0530 Message-Id: <20240815105924.1389290-3-jain.abhinav177@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240815105924.1389290-1-jain.abhinav177@gmail.com> References: <20240815105924.1389290-1-jain.abhinav177@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Implement on/off testing for all non-fixed features via while loop. Save the initial state so that it can be restored after on/off checks. Signed-off-by: Abhinav Jain --- tools/testing/selftests/net/netdevice.sh | 37 +++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/netdevice.sh b/tools/testing/selftests/net/netdevice.sh index 0c32950fdd17..50f7b9d1163d 100755 --- a/tools/testing/selftests/net/netdevice.sh +++ b/tools/testing/selftests/net/netdevice.sh @@ -124,7 +124,42 @@ kci_netdev_ethtool() return 1 fi echo "PASS: $netdev: ethtool list features" - #TODO for each non fixed features, try to turn them on/off + + while read -r FEATURE VALUE FIXED; do + [ "$FEATURE" != "Features" ] || continue # Skip "Features" + [ "$FIXED" != "[fixed]" ] || continue # Skip fixed features + feature="${FEATURE%:*}" + + initial_state=$(ethtool -k "$netdev" | grep "$feature:" \ + | awk '{print $2}') + ethtool --offload "$netdev" "$feature" off + if [ $? -eq 0 ]; then + echo "PASS: $netdev: Turned off feature: $feature" + else + echo "FAIL: $netdev: Failed to turn off feature:" \ + "$feature" + fi + + ethtool --offload "$netdev" "$feature" on + if [ $? -eq 0 ]; then + echo "PASS: $netdev: Turned on feature: $feature" + else + echo "FAIL: $netdev: Failed to turn on feature:" \ + "$feature" + fi + + #restore the feature to its initial state + ethtool --offload "$netdev" "$feature" "$initial_state" + if [ $? -eq 0 ]; then + echo "PASS: $netdev: Restore feature $feature" \ + "to initial state $initial_state" + else + echo "FAIL: $netdev: Failed to restore feature" \ + "$feature to default $initial_state" + fi + + done < "$TMP_ETHTOOL_FEATURES" + rm "$TMP_ETHTOOL_FEATURES" kci_netdev_ethtool_test 74 'dump' "ethtool -d $netdev" From patchwork Thu Aug 15 10:59:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhinav Jain X-Patchwork-Id: 13764656 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9FE641AC89A; Thu, 15 Aug 2024 10:59:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723719600; cv=none; b=jnLlyAJhlwjuoATYc/IE0onB7N/nZSKymet4HuUlvkfWorTwUMfDwb/vKcE/QU0L/W8cgE92j2fmiJdNtozJw926TpmKSw1vYan1iNnkihEbxY4XN/2tIJywh1OSiujs1AJoXVjDsTW5JFudpKZ/huIMYoIbCsFaoxT5jJzoQ5U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723719600; c=relaxed/simple; bh=/WcUu2p5Lk7hWXywCIwNFHFP+xdINS3kR+wr3vCrjIw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KgfJS1sItYK+u+SURBDeVl4QKJMOjHUuRFDXX53A04dAw4X/zaziYm3xd69wQJ4UykHaw7A84lNioaGzr9z7xDcemkdgu1e/urhCGEeNhtRrPedChyITKk2jBixzLDv/ec2gxdiCUpObaOSb5F4c6D/M5vXWa7hg0kG8sDRS8rA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=XtawL3H6; arc=none smtp.client-ip=209.85.210.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XtawL3H6" Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-710ffaf921fso498501b3a.1; Thu, 15 Aug 2024 03:59:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723719597; x=1724324397; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=R491SSux1DQSWKVz1maSbeuZHf+MaOkhtq9L4FMhxUY=; b=XtawL3H6ZEDF+9Z8lz1YbuhfLeFbQnPO+U1jiEeeAwt6c2p1A4DNu3Um4G3AEwnUrL RwQsqb9cg00iVnyVk8WKi9kwtJAI+sa4n4pLBrto9Xp7Uxz2omlpcAUFIXlyB+K90ayv JjlHoQu48IxFfK3g+rsK5puAXYowbo8JsSNZbmWtaupCP8eTaM736dj4zItWiMTI7XFf g1bnfY0tYeobYD4q3pLUlNVPGPNBe9rCtoN849t4JLtW6GE00UOKIUSfUnADalXA92EA vfdopZ55sAeGDdw05KNfm7wwmPo+wHC9i88vQ9pRPDvwSq7AWX519cHabxLwK5JnXfKF 1vmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723719597; x=1724324397; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R491SSux1DQSWKVz1maSbeuZHf+MaOkhtq9L4FMhxUY=; b=PQrzMrLMvxhs0jJ17E8DH3rEqmRRokyeF3cBTYby2NC8UXkxJ+U9LkAvlr7mLUv54J 1WitNBDYX4107LUrl2VX0s0O3NB2Ahln2bxe6svnyVHSWR9nACaHmvJFR6x8PjSn5jr8 OjfLcRaDq7flnHXvgczdvrMjp24YttPoqGwZdNW0xSmFHtnxiNvPAik9o0ZdGyvUtrP0 6SvoqZZmMNAKkdRvgwFcJHwre8WcQeqyplsiImfyjAnumckqZFdwOBQIpm1yD6qR4LiQ YsLVOr/mrabbilejjYgBqW14NWV+FunReiGQoY0riVEe9jX62R2udyjUZjUb56enb2xS yv7w== X-Forwarded-Encrypted: i=1; AJvYcCUO7Q21Yg2d7oTbWmif+Flt2MGGC9FPH/vmQqyP8+hg6sWXq5Z0PccYw9ya6tLaQEl0daoGz0fjLNrCVUNuKOammoIBsl7G8oaVEJYAp/OcqoAXwl/T2NsLdQJlG2R+OxkD+dt35lu0rznyJNksb6HiiDNs8gYeteUkBClbFYDbXQpNwNuz X-Gm-Message-State: AOJu0Yz0tEeiVWWthnh9RF7HlvaoCMCUMHRS2hzgYwejUvD64H/IJMzM KP7ARzMZCd2DzhFpMv07ZXf09irOqotT73hHozawzLz4BURTxZc2 X-Google-Smtp-Source: AGHT+IETL78m7ZeFry37MvMQPHrFPUt9B9nhglzozLw6jieNURmmJlYaUSBLeFyUmEfLsTy9tRJC9w== X-Received: by 2002:a05:6a20:dd92:b0:1c6:b0cc:c510 with SMTP id adf61e73a8af0-1c8f859e84fmr4263287637.9.1723719596662; Thu, 15 Aug 2024 03:59:56 -0700 (PDT) Received: from dev0.. ([2405:201:6803:30b3:f070:7306:329d:c8ca]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7127ae6c76fsm829915b3a.94.2024.08.15.03.59.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 03:59:56 -0700 (PDT) From: Abhinav Jain To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, shuah@kernel.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: skhan@linuxfoundation.org, javier.carrasco.cruz@gmail.com, Abhinav Jain Subject: [PATCH v7 net-next 3/3] selftests: net: Use XFAIL for operations not supported by the driver Date: Thu, 15 Aug 2024 16:29:24 +0530 Message-Id: <20240815105924.1389290-4-jain.abhinav177@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240815105924.1389290-1-jain.abhinav177@gmail.com> References: <20240815105924.1389290-1-jain.abhinav177@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Check if veth pair was created and if yes, xfail on setting IP address. Use XFAIL instead of SKIP for unsupported ethtool APIs. Signed-off-by: Abhinav Jain --- tools/testing/selftests/net/netdevice.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/net/netdevice.sh b/tools/testing/selftests/net/netdevice.sh index 50f7b9d1163d..15d702adb0ea 100755 --- a/tools/testing/selftests/net/netdevice.sh +++ b/tools/testing/selftests/net/netdevice.sh @@ -68,7 +68,11 @@ kci_net_setup() fi # TODO what ipaddr to set ? DHCP ? - echo "SKIP: $netdev: set IP address" + if [ "$veth_created" ]; then + echo "XFAIL: $netdev: set IP address" + else + echo "SKIP: $netdev: set IP address" + fi return $ksft_skip } @@ -86,7 +90,7 @@ kci_netdev_ethtool_test() ret=$? if [ $ret -ne 0 ];then if [ $ret -eq "$1" ];then - echo "SKIP: $netdev: ethtool $2 not supported" + echo "XFAIL: $netdev: ethtool $2 not supported" return $ksft_skip else echo "FAIL: $netdev: ethtool $2"