From patchwork Wed Mar 12 21:42:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Mayhew X-Patchwork-Id: 14013938 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 97BCC7083C for ; Wed, 12 Mar 2025 21:42:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741815760; cv=none; b=iy3BbmSPcvS8ziNNf8ubTIMqDvd4JJMCCHlOMXs7wGQRJ5EEtqan+9yBiys0sAjuIbIcYDzzOX9tv1xMXXpreGjl2YU7p0Dw9ULvTC+dpAcPYBs2rVe9ABUc54qas/dVzfh0ViAgBLM6BLuew/UChhbtYGv6OrK9IjzRnYYKoGg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741815760; c=relaxed/simple; bh=TGibZaf/X0jWpfy1jl14eFdIEidmu0so3sx2XJ+B17g=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:content-type; b=tXr2kWbb22GPsFkrMIRh/OWEy57WhEo9Lq0j7Q2EyYEPWzTHDhBYYVjvcOfRIv6ms6SrAxHQDxtJz5ky9eecf5m1+UKzkT8cYh0sFLrZSD7C/mi5iK5OUvyRuqHe1z8k6o85SdskHxBnyMy4nPr4pAL9JkZJcu7pEqKrZD2R9Qk= 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=BfOXjZN0; arc=none smtp.client-ip=170.10.133.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="BfOXjZN0" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741815757; 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=r6eH+8cgm9VqXdWFjgi+SuWINVG2NR00exgxZp7NxXU=; b=BfOXjZN09LKYSGjBTR5AzfAtJam8XEsol4VPfKn1nn7+fUZEPZW4RfkaoCSMrwhZFQcZdk HL8vxI+wBtydN/u3sf/Rnn3lZBErpzKvJdEph8GO5PmFqOctdWC42+bp79SRiVEOkZdA0R hzvS4KRQ/C0Y6n9D8PQy48MvanJYxNs= Received: from mx-prod-mc-08.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-102-zYi1CjnBMZGrUxxaPKeT7g-1; Wed, 12 Mar 2025 17:42:35 -0400 X-MC-Unique: zYi1CjnBMZGrUxxaPKeT7g-1 X-Mimecast-MFC-AGG-ID: zYi1CjnBMZGrUxxaPKeT7g_1741815755 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D3A8B180AF57 for ; Wed, 12 Mar 2025 21:42:34 +0000 (UTC) Received: from aion.redhat.com (unknown [10.22.80.106]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9BCEF1828ABC 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 C3BA0338A11 for ; Wed, 12 Mar 2025 17:42:32 -0400 (EDT) From: Scott Mayhew To: kdevops@lists.linux.dev Subject: [PATCH v2 4/9] ltp: add last-run directory and last-kernel.txt to the results Date: Wed, 12 Mar 2025 17:42:27 -0400 Message-ID: <20250312214232.955450-5-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.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 1M8YhCoAmoVLQF_B0_BCmod7alrRghdx6gChAkZvskM_1741815755 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/ltp/tasks/main.yml | 60 ++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 4 deletions(-) diff --git a/playbooks/roles/ltp/tasks/main.yml b/playbooks/roles/ltp/tasks/main.yml index b15f87d..8baa47f 100644 --- a/playbooks/roles/ltp/tasks/main.yml +++ b/playbooks/roles/ltp/tasks/main.yml @@ -20,17 +20,52 @@ tags: ['vars'] ansible.builtin.set_fact: ltp_test_group: "{{ ansible_host | regex_replace(kdevops_host_prefix + '-') | regex_replace('-dev') }}" - ltp_results_dir: "../workflows/ltp/results/{{ ansible_kernel }}" + ltp_results_full_path: "{{ topdir_path }}/workflows/ltp/results" + ltp_results_target: "../workflows/ltp/results/last-run" - name: Create the local results directory tags: ['first_run'] ansible.builtin.file: - path: "{{ ltp_results_dir }}" + path: "{{ ltp_results_full_path }}" state: directory mode: "u=rwx,g=rx,o=rx" delegate_to: localhost run_once: true +- name: Clean up our localhost results/last-run directory + local_action: file path="{{ ltp_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="{{ ltp_results_target }}/" state=directory + run_once: true + tags: [ 'run_tests', 'copy_results', 'clean_local_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 }} > {{ ltp_results_target }}/../last-kernel.txt" + tags: [ 'run_tests', 'copy_results', 'print_results' ] + run_once: true + +- name: Ensure the local results directory exists + tags: copy_results + ansible.builtin.file: + path: "{{ ltp_results_full_path }}/last-run/{{ last_kernel }}/{{ ltp_test_group }}" + state: directory + mode: "u=rwx,g=rx,o=rx" + delegate_to: localhost + - name: Set OS-specific variables ansible.builtin.include_vars: "{{ lookup('ansible.builtin.first_found', params) }}" vars: @@ -195,7 +230,7 @@ tags: ['copy_results'] ansible.builtin.fetch: src: "{{ item.path }}" - dest: "{{ ltp_results_dir }}/{{ ltp_test_group }}/" + dest: "{{ ltp_results_full_path }}/last-run/{{ last_kernel }}/{{ ltp_test_group }}/" flat: true validate_checksum: false with_items: "{{ results_files.files }}" @@ -217,7 +252,7 @@ tags: ['copy_results'] ansible.builtin.fetch: src: "{{ item.path }}" - dest: "{{ ltp_results_dir }}/{{ ltp_test_group }}/" + dest: "{{ ltp_results_full_path }}/last-run/{{ last_kernel }}/{{ ltp_test_group }}/" flat: true validate_checksum: false with_items: "{{ output_files.files }}" @@ -225,3 +260,20 @@ - output_files.matched > 0 loop_control: label: "Copying {{ item.path | basename }} ..." + +- name: Verify last-run kernel directory exists + tags: [ 'copy_results' ] + delegate_to: localhost + stat: + path: "{{ ltp_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: "{{ ltp_results_full_path }}/last-run/{{ last_kernel }}" + dest: "{{ ltp_results_full_path }}/" + run_once: true + tags: [ 'copy_results' ] + delegate_to: localhost + when: + - last_run_kernel_dir.stat.exists