mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-08-04 16:36:58 +00:00
fbc8fad78d
Three of the files under xCAT-test/unit are not unit tests. They need an
installed management node rather than a checkout: copycds_packages_integrity.t
wants an /install populated by a real copycds, dhcp_kea_config_validation.t
wants a kea-dhcp4 binary that can read the config it generates, and
dhcp_kea_control_agent_smoke.t wants live kea-dhcp4 and kea-ctrl-agent
daemons running as root.
On a GitHub runner none of that exists, so all three plan skip_all. They were
the only three files skipping in the pull request run, which is not a
coincidence -- the skip is the symptom of them being filed in the wrong place.
A skipped test reports neither pass nor fail, so leaving them mixed in with
the unit tests trains the reader to scroll past skips in a directory where a
skip should mean something is wrong.
Move them to xCAT-test/integration, ship that directory alongside unit in
both the rpm and the deb, and drive it from a new xcattest testcase that
proves the installed copy on an MN. The case is deliberately not labelled
ci_test: the pull request workflow has no management node and must not pick
it up. check:rc==0 is the right gate for it -- prove exits non-zero on a real
failure, exits 0 when a test legitimately skips on a node without Kea, and
exits 2 if the directory is missing entirely, so a packaging regression still
fails the case.
Add a README.md to each directory recording which side of the line a new test
belongs on and how each suite is run.
xCAT-test/unit is now 44 files and 802 assertions with no skips at all; the
assertion count is unchanged, confirming the three moved files were
contributing nothing but skips.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
(cherry picked from commit 6ab9aca0b7)
86 lines
2.6 KiB
RPMSpec
86 lines
2.6 KiB
RPMSpec
Summary: xCAT automated test tool
|
|
Name: xCAT-test
|
|
Version: %{?version:%{version}}%{!?version:%(cat Version)}
|
|
Release: %{?release:%{release}}%{!?release:%(cat Release)}
|
|
Epoch: 4
|
|
License: EPL
|
|
Group: Applications/System
|
|
Source: xCAT-test-%{version}.tar.gz
|
|
Packager: IBM Corp.
|
|
Vendor: IBM Corp.
|
|
Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}}
|
|
Prefix: /opt/xcat
|
|
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
|
|
# Pod::Html ships inside the core perl package on SUSE; there is no perl-Pod-Html
|
|
%if !0%{?suse_version}
|
|
BuildRequires: perl-Pod-Html
|
|
%endif
|
|
|
|
# AIX will build with an arch of "ppc"
|
|
%ifos linux
|
|
BuildArch: noarch
|
|
%endif
|
|
|
|
%description
|
|
Provides automated test tool and buckets to help test xCAT commands automatically.
|
|
|
|
%prep
|
|
%setup -q -n xCAT-test
|
|
%build
|
|
|
|
# Convert pods to man pages and html pages
|
|
mkdir -p share/man/man1
|
|
mkdir -p share/doc/man1
|
|
pod2man pods/man1/xcattest.1.pod > share/man/man1/xcattest.1
|
|
pod2man pods/man1/xcatperftest.1.pod > share/man/man1/xcatperftest.1
|
|
pod2html pods/man1/xcattest.1.pod > share/doc/man1/xcattest.1.html
|
|
pod2html pods/man1/xcatperftest.1.pod > share/doc/man1/xcatperftest.1.html
|
|
|
|
%install
|
|
# The install phase puts all of the files in the paths they should be in when the rpm is
|
|
# installed on a system. The RPM_BUILD_ROOT is a simulated root file system and usually
|
|
# has a value like: /var/tmp/xCAT-test-2.0-snap200802270932-root
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{prefix}/bin
|
|
mkdir -p $RPM_BUILD_ROOT/%{prefix}/sbin
|
|
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/tools/autotest
|
|
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/man/man1
|
|
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/man1
|
|
|
|
cp bin/* $RPM_BUILD_ROOT/%{prefix}/bin
|
|
cp xcattest $RPM_BUILD_ROOT/%{prefix}/bin
|
|
chmod 755 $RPM_BUILD_ROOT/%{prefix}/bin/*
|
|
|
|
cp restapitest $RPM_BUILD_ROOT/%{prefix}/sbin
|
|
chmod 755 $RPM_BUILD_ROOT/%{prefix}/sbin/*
|
|
|
|
# These were built dynamically in the build phase
|
|
cp share/man/man1/* $RPM_BUILD_ROOT/%{prefix}/share/man/man1
|
|
chmod 444 $RPM_BUILD_ROOT/%{prefix}/share/man/man1/*
|
|
cp share/doc/man1/* $RPM_BUILD_ROOT/%{prefix}/share/doc/man1
|
|
chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/doc/man1/*
|
|
|
|
cp -r autotest $RPM_BUILD_ROOT/%{prefix}/share/xcat/tools
|
|
cp -r unit $RPM_BUILD_ROOT/%{prefix}/share/xcat/tools/autotest
|
|
cp -r integration $RPM_BUILD_ROOT/%{prefix}/share/xcat/tools/autotest
|
|
|
|
|
|
%clean
|
|
# This step does not happen until *after* the %files packaging below
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
%files
|
|
%defattr(-,root,root)
|
|
#%doc LICENSE.html
|
|
# Just package everything that has been copied into RPM_BUILD_ROOT
|
|
%{prefix}
|
|
|
|
%changelog
|
|
* Tue Sep 14 2010 - Airong Zheng <zhengar@us.ibm.com>
|
|
- "Create xCAT autotest package"
|
|
|
|
%post
|
|
|
|
%preun
|