2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-10-07 10:06:39 +00:00
Files
xcat-core/xCAT-test/xCAT-test.spec
T
Daniel Hilst 711c4870db test(provtest): add the autotest cases and ship the tree in the packages
Ten cases: two offline ones labelled ci_test, the unit suite and a parse
of every shipped scenario, and eight wire cases labelled prov_wire, one
per stage of the chain a node walks -- DNS, loader and config, install
tree, genesis and discovery artefacts, discovery requests, the xcatd
protocols, the install monitor, and the three failures that look alike
from a console.

The wire cases are deliberately not ci_test: while one runs the
management node has an extra veth pair and namespace, four nodes, a
rewritten zone and possibly a moved http port. Each restores all of it
from a trap, and each passes with a message when the host cannot host it.

provfixture.sh holds every xCAT command; the scenarios read none of it.
2026-09-11 09:00:54 -03:00

102 lines
3.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
# dhcptest needs scapy, which lives in EPEL on EL rather than in the base
# repositories. A hard Requires: would make this package uninstallable on a
# management node without EPEL, so it is only recommended: dhcptest exits 3
# with an actionable message when scapy is absent, and nothing else in
# xCAT-test needs it. Recommends: is not understood by rpm before EL 8.
%if 0%{?suse_version} || 0%{?rhel} >= 8
Recommends: python3-scapy
%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
cp -r dhcptest $RPM_BUILD_ROOT/%{prefix}/share/xcat/tools/autotest
chmod 755 $RPM_BUILD_ROOT/%{prefix}/share/xcat/tools/autotest/dhcptest/src/dhcptest
# provtest needs nothing that is not already on a management node: dig, tftp
# and curl come with the DNS, TFTP and HTTP the node itself talks to, and the
# xcatd client is python3 and the standard library.
cp -r provtest $RPM_BUILD_ROOT/%{prefix}/share/xcat/tools/autotest
chmod 755 $RPM_BUILD_ROOT/%{prefix}/share/xcat/tools/autotest/provtest/src/provtest
%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