From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0BE7E2E2DE7 for ; Mon, 11 Aug 2025 22:24:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754951097; cv=none; b=NamwKEEw5tVX2cVGjtAfH9r1V9aD2zo4ze8rWZ67x+hpzCMgd64XkZTvGNCoysek3b6Ses2nKMwuOdd982QGL4T4JFVfFbSr/lJmsNIKQT04sLPsZHHk3BriTvLTulQ3o1a+D5s+0OOdphdcV6ovPOQSAGdd6eT9DSUZIHiDtjc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754951097; c=relaxed/simple; bh=pSXvsgDHlY3vc64uxpdh/TK0/ajtaAeeXHgDLgEqd6g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=k8TXA1wE6s2a42du469XdqGh0mQy3QuiX0YqSBg1AhzUnwr1iVcBz4iDaslo75hyfIBJzHwAWvgS6qyd8eH2daFfK9cx7Z6UYpOnzert89lu2H82iFoPI2cPVJRXgpGwsmWF3MGOjX1qa9rY0fYDOGMIaeHCatdsdXs1ggZIAE0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=BBk16GmN; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="BBk16GmN" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=s6nqmUHSBm04uwqQ+Z+hIzt2m/kUKqaF54QabJkhL24=; b=BBk16GmNowc5oUvDnS5HEzul4/ TPZdISuZwJh1RbMoLyYIsuspUzH1vujhLdNrqGFBrTCTLFuc/nhXjBiJFGW/9uLxUR1fMZuLWluJv X6rDu1H1t4438FqX9+mShDsdEzxnjDl1HFsE0uF1Wjw/FTKCmdIp++9lTBCLs2XWBK2WIV3cpNaVW Wbn1HHNJK76A++BS9Vraqh1pa4KST/ULx/HSm6T649/kd8SUEfZg3Om73AqNcNKEs0hDd6Wk1gPT4 7V3W+8/iEpEGVlTirixgs49T26NJPUz4MBbp1B8OxgFQqQLhTBKBo9hRGLHAW6zozd69STcCySVJS Mrq+ciTg==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1ulawn-00000009Hkk-48dD; Mon, 11 Aug 2025 22:24:53 +0000 From: Luis Chamberlain To: Chuck Lever , Daniel Gomez , kdevops@lists.linux.dev Cc: Luis Chamberlain Subject: [PATCH 22/23] reboot-limit: handle empty dev group gracefully Date: Mon, 11 Aug 2025 15:24:49 -0700 Message-ID: <20250811222452.2213071-23-mcgrof@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250811222452.2213071-1-mcgrof@kernel.org> References: <20250811222452.2213071-1-mcgrof@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Luis Chamberlain The reboot-limit-dev target was failing when the dev group had no hosts, which is a common configuration when not using A/B testing. Fix by checking if the dev group has any hosts before attempting to run ansible-playbook. This allows reboot-limit-tests to work correctly even when only baseline hosts are configured. The check uses a simple grep to see if there are any hostnames listed after the [dev] group header in the hosts file. Generated-by: Claude AI Signed-off-by: Luis Chamberlain --- workflows/demos/reboot-limit/Makefile | 29 ++++++++++++++++----------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/workflows/demos/reboot-limit/Makefile b/workflows/demos/reboot-limit/Makefile index 0539720b..384442f4 100644 --- a/workflows/demos/reboot-limit/Makefile +++ b/workflows/demos/reboot-limit/Makefile @@ -175,19 +175,24 @@ reboot-limit-baseline-reset: reboot-limit-tests: reboot-limit-baseline reboot-limit-dev # Below are the corresponding dev targets +# Check if dev group has hosts before running reboot-limit-dev: $(KDEVOPS_EXTRA_VARS) - $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \ - --limit 'dev' \ - playbooks/reboot-limit.yml \ - --tags vars,first_run,reset \ - --extra-vars=@./extra_vars.yaml \ - --extra-vars="reboot_limit_max=$(REBOOT_LIMIT_MAX)" - $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \ - --limit 'dev' \ - playbooks/reboot-limit.yml \ - --tags vars,run_tests,copy_results \ - --extra-vars=@./extra_vars.yaml \ - --extra-vars="reboot_limit_max=$(REBOOT_LIMIT_MAX)" + $(Q)if grep -A1 '^\[dev\]' hosts | grep -qE '^[a-zA-Z0-9]'; then \ + ansible-playbook $(ANSIBLE_VERBOSE) \ + --limit 'dev' \ + playbooks/reboot-limit.yml \ + --tags vars,first_run,reset \ + --extra-vars=@./extra_vars.yaml \ + --extra-vars="reboot_limit_max=$(REBOOT_LIMIT_MAX)" && \ + ansible-playbook $(ANSIBLE_VERBOSE) \ + --limit 'dev' \ + playbooks/reboot-limit.yml \ + --tags vars,run_tests,copy_results \ + --extra-vars=@./extra_vars.yaml \ + --extra-vars="reboot_limit_max=$(REBOOT_LIMIT_MAX)"; \ + else \ + echo "No hosts found in dev group, skipping dev tests"; \ + fi reboot-limit-dev-loop: $(Q)$(REBOOT_LIMIT_LOOP) dev -- 2.47.2