From patchwork Wed Mar 5 00:57:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Mayhew X-Patchwork-Id: 14001720 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 3532B136E37 for ; Wed, 5 Mar 2025 00:57:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741136282; cv=none; b=CUQHosqnGc1evPvAr91uxE0Qg/sndvTCE+iYJGsfsHL2c4wsOqO6YsLUDMrIUBV6xlDcHpD/IyYVTrHGuD6EfEtR7tPo6Rj4o9As6tP38l7tPDfanvUR7bQoDLVfRBxEjwF/GdGNEDsVfN6b6LXCL8UHp+YsmYfPuZ9AP2hDhsA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741136282; c=relaxed/simple; bh=Np93AYx1IBzjOs2+ShMtVneEcDZgsXJEpouk6UQYrRg=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:content-type; b=lK/mRCa3/kePz+fiFZU/pOBrSBm0rtndRD1wd5EFg/HzoyUDFA3wlrugj6IaWtYNZsH83rI3xbE3LWhEq0drLm0Ho3p3sEhbLcc2eEAfe3ZqoM6NP1ImRAB0zDMtovFsxjjvVEvJ+s9peMBnrkun6QlTsjL2WdINMM9KLObHWjk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=KrkLHmvq; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="KrkLHmvq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741136279; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=br3++1S8R5qJzaQ1J4gH/qENu3cT9CmFUHZ51Pl7GJE=; b=KrkLHmvqiuBBhX3W1kHgdaOadIPxaXRHzR8UxD2RTMsw/pxDFY0Uz6FaTTLRfQD2Ph5Bsi PW0x4dWDYsCe+Kyk54AnsmM8qK+i4t29/vu+rS6KxaZCT1FOpdTEUWwYuMagZZiHI91Rqy KmpG++tHXvPO7CdPjAvXQyk/evZlUcw= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-609-EevltZbtNEOCT61jTVX2Jg-1; Tue, 04 Mar 2025 19:57:58 -0500 X-MC-Unique: EevltZbtNEOCT61jTVX2Jg-1 X-Mimecast-MFC-AGG-ID: EevltZbtNEOCT61jTVX2Jg_1741136277 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3DB411800986 for ; Wed, 5 Mar 2025 00:57:57 +0000 (UTC) Received: from aion.redhat.com (unknown [10.22.64.10]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0F2DD19560A3 for ; Wed, 5 Mar 2025 00:57:57 +0000 (UTC) Received: from aion.redhat.com (localhost [IPv6:::1]) by aion.redhat.com (Postfix) with ESMTP id 8847D33728E for ; Tue, 04 Mar 2025 19:57:55 -0500 (EST) From: Scott Mayhew To: kdevops@lists.linux.dev Subject: [PATCH 2/9] nfstest: add last-run directory and last-kernel.txt to the results Date: Tue, 4 Mar 2025 19:57:47 -0500 Message-ID: <20250305005755.697599-4-smayhew@redhat.com> In-Reply-To: <20250305005755.697599-1-smayhew@redhat.com> References: <20250305005755.697599-1-smayhew@redhat.com> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: GTXFHEAd1E-dM-VFKI7Ch0Mq6l787XoYSAXbQ_arFak_1741136277 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true Create the last-run directory and last-kernel.txt file in a manner similar to the way the fstests workflow does it. This will make it easier to get at the most recent test results for reporting purposes. Signed-off-by: Scott Mayhew --- playbooks/roles/nfstest/tasks/main.yml | 60 ++++++++++++++++++++++---- 1 file changed, 52 insertions(+), 8 deletions(-) diff --git a/playbooks/roles/nfstest/tasks/main.yml b/playbooks/roles/nfstest/tasks/main.yml index 8c8db02..bf5cd9f 100644 --- a/playbooks/roles/nfstest/tasks/main.yml +++ b/playbooks/roles/nfstest/tasks/main.yml @@ -131,6 +131,24 @@ tags: - run_tests +- name: Set the pathname of the results directory + ansible.builtin.set_fact: + nfstest_results_full_path: "{{ topdir_path }}/workflows/nfstest/results" + nfstest_results_target: "../workflows/nfstest/results/last-run" + when: + - kdevops_workflows_dedicated_workflow|bool + tags: copy_results + +- name: Clean up our localhost results/last-run directory + local_action: file path="{{ nfstest_results_target }}/" state=absent + run_once: true + tags: [ 'run_tests', 'copy_results', 'clean_local_results' ] + +- name: Create empty last-run directory + local_action: file path="{{ nfstest_results_target }}/" state=directory + run_once: true + tags: [ 'run_tests', 'copy_results', 'clean_local_results' ] + - name: Run the test group script on the target node ansible.builtin.command: cmd: "/tmp/runtest.sh" @@ -138,16 +156,25 @@ - kdevops_workflows_dedicated_workflow|bool tags: run_tests -- name: Set the pathname of the results directory - ansible.builtin.set_fact: - nfstest_results_dir: "../workflows/nfstest/results/{{ ansible_kernel }}" - when: - - kdevops_workflows_dedicated_workflow|bool - tags: copy_results +- name: Get used target kernel version + tags: [ 'copy_results' ] + command: "uname -r" + register: uname_cmd + +- name: Store last kernel variable + tags: [ 'copy_results' ] + set_fact: + last_kernel: "{{ uname_cmd.stdout_lines | regex_replace('\\]') | regex_replace('\\[') | replace(\"'\",'') }}" + run_once: true + +- name: Document used target kernel version + local_action: "shell echo {{ last_kernel }} > {{ nfstest_results_target }}/../last-kernel.txt" + tags: [ 'run_tests', 'copy_results', 'print_results' ] + run_once: true - name: Create the results directory on the control node ansible.builtin.file: - path: "{{ nfstest_results_dir }}" + path: "{{ nfstest_results_full_path }}/last-run/{{ last_kernel }}" state: directory mode: "u=rwx,g=rx,o=rx" delegate_to: localhost @@ -168,7 +195,7 @@ - name: Copy the output logs to the control node ansible.builtin.fetch: src: "{{ item.path }}" - dest: "{{ nfstest_results_dir }}/{{ nfstest_test_group }}/" + dest: "{{ nfstest_results_full_path }}/last-run/{{ last_kernel }}/{{ nfstest_test_group }}/" flat: true with_items: "{{ nfstest_logs.files }}" loop_control: @@ -178,3 +205,20 @@ - kdevops_workflows_dedicated_workflow|bool changed_when: false tags: copy_results + +- name: Verify last-run kernel directory exists + tags: [ 'copy_results' ] + delegate_to: localhost + stat: + path: "{{ nfstest_results_full_path }}/last-run/{{ last_kernel }}" + register: last_run_kernel_dir + +- name: Copy over the last-run into the results directory for archiving into kdevops + copy: + src: "{{ nfstest_results_full_path }}/last-run/{{ last_kernel }}" + dest: "{{ nfstest_results_full_path }}/" + run_once: true + tags: [ 'copy_results' ] + delegate_to: localhost + when: + - last_run_kernel_dir.stat.exists