From patchwork Wed Mar 12 21:42:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Mayhew X-Patchwork-Id: 14013939 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 B55E61D5175 for ; Wed, 12 Mar 2025 21:42:37 +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=1741815760; cv=none; b=e6aKK8R7UWi978WUemQzdADCLaC5zYVpd2C90CpWHcNUMzbk4NzIPBsC+qZ5QIIsxjXgMqDCGwKfS4Mhz1OeMGA8T4brDiqqBSUURGsQBTGt1/M5jl7zVVZO2Gd76oDPjR9m7XqQeQrynq97cL7myRXXq6q+FRb6SCYTh6spMIk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741815760; c=relaxed/simple; bh=Np93AYx1IBzjOs2+ShMtVneEcDZgsXJEpouk6UQYrRg=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:content-type; b=mbDvA3WMXs6GG8sqOZL0yu0vKoQlrVYm0rT0yrxcC3juprAGxqbwaxkQxzkuHrJU72oVyR4DPkw6DUr0AzV41NVJAAiaVloi6MUeV4weWHUBmM+KN+J6vAGccsOvpzUYt1i0NPktREN4GU+H7OkVE23m5aQ3bpxS7b1G8mbnuN4= 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=BgufqGLC; 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="BgufqGLC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741815756; 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=BgufqGLChMQzYutM79LWH2BSz82asXLhmw375rXMwXSQYw11rQN5CVQePHBmo83IEOtlVk ssv1rCHqCqTolBPuoDTK3yUJX0fjuCg/RTrXvvig8ZeaThBPrWsUN8vzSVVfR48nlMQc2N LPD2eg91QxmCUknZoeGcXjvSOGLxAFs= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-593-PQT4ixDSNxezwXyC1jZh0A-1; Wed, 12 Mar 2025 17:42:35 -0400 X-MC-Unique: PQT4ixDSNxezwXyC1jZh0A-1 X-Mimecast-MFC-AGG-ID: PQT4ixDSNxezwXyC1jZh0A_1741815754 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8BE211955D81 for ; Wed, 12 Mar 2025 21:42:34 +0000 (UTC) Received: from aion.redhat.com (unknown [10.22.80.106]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 596601955BFE for ; Wed, 12 Mar 2025 21:42:34 +0000 (UTC) Received: from aion.redhat.com (localhost [IPv6:::1]) by aion.redhat.com (Postfix) with ESMTP id A9DB0338A0F for ; Wed, 12 Mar 2025 17:42:32 -0400 (EDT) From: Scott Mayhew To: kdevops@lists.linux.dev Subject: [PATCH v2 2/9] nfstest: add last-run directory and last-kernel.txt to the results Date: Wed, 12 Mar 2025 17:42:25 -0400 Message-ID: <20250312214232.955450-3-smayhew@redhat.com> In-Reply-To: <20250312214232.955450-1-smayhew@redhat.com> References: <20250312214232.955450-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.15 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: KRWLj7uSB4DV2nzqxV7kUqCMQeZst2Dfxder9ttL8r0_1741815754 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