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 198AF7DA93 for ; Sun, 20 Apr 2025 05:48:25 +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=1745128107; cv=none; b=YbS5+/OSUKvQS992w605WRyIppUv+yqkSsKVNFfcXFJyIENxj/nM4aMoVjd+HXYXs+Vd9SakgkJ2LmvpdRAAwhTE86t/C8A9MZnt2rsrh8ILQTjU88UPvSuWJeDMfe3F8i4Y0RDWFyenUyFCVyRTgFrDc9jUwQ8jLQ+XXcQ+x9Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745128107; c=relaxed/simple; bh=jqwwPoGeMvaDmUwuUULXg2A+nB4yZHwDFSEeTOve2JY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iDjnQortm3C5RmHkddbKZbagc5JkjrgoBdGsvdBEwtqZfugwHch/R+imesh2jOEB9C0ZwkovEwPQy6YA0R2iX3rzpiUR9JVt0sqx7xVll2TvKroBGJMCBAInEPUSxZtuyDibnqYLotAL/Q9DQ0uwsxfoEVavQXg4xu0Y4NKWaKo= 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=cD/qVZzP; 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="cD/qVZzP" 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=V5+b3Py/y3kAKKzfWm8wJCAuPVE4WOIZyZiDNHs2TVA=; b=cD/qVZzP9SNsfpEsxWvNJU9P9d ls/4Cr8BDsYHStKNnobVFlFc+3WU3IiuKRTF/AiNroQsJfcHEn7ANny7Hd0QGqWby5mSaAVDwjZZ+ nlsEWigDJdIHGUVtZFaq0cF4qWQYXAyJKIIg/fk+O8Guy2WJzVaQC+GsE8le2nprzzh1VsytP2LJO d+I9pXCGNFC72K1ZDeiQXEQNmFbRGa9iX3iqqFyan2qYWXA5qzSbGkGiW2SBehQvphPlWF9QkKWyk 7VX5bA203kDzjst+baU+a323TETk2aucaTjgbZvu7rU2hOw5MHFXnhesBzUxY1r9PnE2NiTPAV7Mu uCXunUTA==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1u6NXV-00000002Euz-2Boz; Sun, 20 Apr 2025 05:48:25 +0000 From: Luis Chamberlain To: Chuck Lever , Daniel Gomez , kdevops@lists.linux.dev Cc: Luis Chamberlain Subject: [PATCH 1/5] systemd-remote: use ip address for systemd-remote journal Date: Sat, 19 Apr 2025 22:48:17 -0700 Message-ID: <20250420054822.533987-2-mcgrof@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250420054822.533987-1-mcgrof@kernel.org> References: <20250420054822.533987-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 We have to run 'make journal-ln' to make the hostname match, but we can just use a ssh -G trick to get the IP address since we already have that on our ssh configuration. This means we can later kill running 'make journal-ln'. Signed-off-by: Luis Chamberlain --- scripts/workflows/lib/systemd_remote.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/scripts/workflows/lib/systemd_remote.py b/scripts/workflows/lib/systemd_remote.py index f7ce4b556de1..c95ca7e57bd5 100644 --- a/scripts/workflows/lib/systemd_remote.py +++ b/scripts/workflows/lib/systemd_remote.py @@ -13,6 +13,16 @@ class TimeoutExpired(SystemdError): self.error_code = errcode return "timeout" +def get_host_ip(host): + try: + result = subprocess.run(["ssh", "-G", host], capture_output=True, text=True, check=True) + for line in result.stdout.splitlines(): + if line.startswith("hostname "): + return line.split()[1] + except subprocess.SubprocessError as e: + logger.warning(f"Failed to resolve IP for {host}: {e}") + return None + def get_current_time(host): format = '%Y-%m-%d %H:%M:%S' today = datetime.today() @@ -20,7 +30,8 @@ def get_current_time(host): return today_str def get_extra_journals(remote_path, host): - extra_journals_path = "remote-" + host + '@' + ip = get_host_ip(host) + extra_journals_path = "remote-" + ip + '@' extra_journals = [] for file in os.listdir(remote_path): if extra_journals_path in file: @@ -29,8 +40,9 @@ def get_extra_journals(remote_path, host): return extra_journals def get_uname(remote_path, host, configured_kernel): + ip = get_host_ip(host) extra_journals = get_extra_journals(remote_path, host) - fpath = remote_path + "remote-" + host + '.journal' + fpath = remote_path + "remote-" + ip + '.journal' grep = "Linux version" grep_str = "\"Linux version\"" cmd = [ @@ -90,10 +102,11 @@ def get_uname(remote_path, host, configured_kernel): # Returns something like "xfs/040 at 2023-12-17 23:52:14" def get_test(remote_path, host, suite): + ip = get_host_ip(host) if suite not in [ 'fstests', 'blktests']: return None # Example: /var/log/journal/remote/remote-line-xfs-reflink.journal - fpath = remote_path + "remote-" + host + '.journal' + fpath = remote_path + "remote-" + ip + '.journal' extra_journals = get_extra_journals(remote_path, host) run_string = "run " + suite cmd = [ -- 2.47.2