From patchwork Mon Mar 3 13:09:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Mayhew X-Patchwork-Id: 13998810 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 D846E211485 for ; Mon, 3 Mar 2025 13:09:53 +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=1741007395; cv=none; b=eCD2sHqBjCpglLXZVTdPBeqwDJn1/O2z2ufqgFV8TkBb+lQ8epxTRLhTSMUAGST18hA+xmDnAYpvjozefbw7q32kNey90n2TU4/QcLNN1gOk2l7601Y3VraDT/OZoOc8Vju0xzDoIBZ/cUZIKdeqwp9dXALoX75iZ7fWScuziQQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741007395; c=relaxed/simple; bh=hwXz9ytn6I0FCeZcCA6FRWdo8dkkG1vn53HdvvBiH0Q=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:content-type; b=PIAH9+/MV9CMzPSxGfkYpxIarva4gv8dywfl2sHBBLDZFaMy9WvDDIo2YEYynWoRXWEx7MtZFT+itEBAgS15XwrKEn21VYKJpFrxJXhr7iobpzC+pbn/DYrbwkGJNHCwEKrs7xgZCj0jUY0EH00pL5KEpUqsn5mVm187NepmUyc= 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=SaNkfAOY; 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="SaNkfAOY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741007392; 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=8WLEhrIWnmk0LecjdFnOmoliPPYQatui/wgG+beBqXg=; b=SaNkfAOYCxMcoD2AG3qTY+ZRAzxLgxak9sVucU6wd0AZrS8Pbn/wKXNoh0OvYlzU5SzsSW M6MSHwXVJKeg00qCAJr2F8ePHcj+qnkB9sUlJTBdv/QneqaEvU+iw8u7p6vsw1o4YcaL+q lyM3d7kk0WeEyUVp2T24ImPMNMCuXmM= 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-576--h5moE9aOmShXL-1iTT76Q-1; Mon, 03 Mar 2025 08:09:51 -0500 X-MC-Unique: -h5moE9aOmShXL-1iTT76Q-1 X-Mimecast-MFC-AGG-ID: -h5moE9aOmShXL-1iTT76Q_1741007390 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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9409D1800992 for ; Mon, 3 Mar 2025 13:09:50 +0000 (UTC) Received: from aion.redhat.com (unknown [10.22.64.10]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 697A6180035F for ; Mon, 3 Mar 2025 13:09:50 +0000 (UTC) Received: from aion.redhat.com (localhost [IPv6:::1]) by aion.redhat.com (Postfix) with ESMTP id E6232336C26 for ; Mon, 03 Mar 2025 08:09:48 -0500 (EST) From: Scott Mayhew To: kdevops@lists.linux.dev Subject: [PATCH 4/9] ltp: add last-run directory and last-kernel.txt to the results Date: Mon, 3 Mar 2025 08:09:43 -0500 Message-ID: <20250303130948.630029-5-smayhew@redhat.com> In-Reply-To: <20250303130948.630029-1-smayhew@redhat.com> References: <20250303130948.630029-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: NK3Ao9hzaOcGoxjXRsndQAcxIjyP-ClqlCaWtyP-zsU_1741007390 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 34cae23..71e1541 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: @@ -194,7 +229,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 }}" @@ -216,7 +251,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 }}" @@ -224,3 +259,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