Skip to content

CNF Testsuite Source Installation for Red Hat Enterprise Linux 8

agentpoyo edited this page Aug 25, 2022 · 10 revisions

Compiling cnf-testsuite on RHEL 8 from source

Install crystal using snapd

The crystal RHEL RPM repositories no longer exist (at time of writing) to install crystal via RPM so the next option is to setup snapd to install crystal (unless you want to compile from source, in which case you'll want to follow the crystal-lang.org instructions).

  • First you need to enable the EPEL repository:
sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
  • Now you can install snapd:
sudo dnf install snapd
  • You may also need to add a symlink in the / directory called snap in order for snapd to install that points to /var/lib/snapd/snap:
cd /
sudo ln -s /var/lib/snapd/snap snap
  • Now you can install crystal with:
sudo snap install crystal --classic

Install other package requirements along with official Docker (removing podman if installed):

One of the tests requires kind which requires docker. Currently kind seems to error when creating clusters using Red Hat's podman alternative to docker.

  • Install git and other required RPMs that will be required by crystal and shards modules:
sudo dnf install git pcre-devel.x86_64 libevent-devel.x86_64 gcc make
  • If you have subscription management access to the Code Ready Builder repository, you can enable that repo to install libyaml-devel package but in our case, we didn't so we just pulled down the CentOS 8 rpm for libyaml-devel that is required with the following command:
sudo rpm -Uvh https://vault.centos.org/centos/8/PowerTools/x86_64/os/Packages/libyaml-devel-0.1.7-5.el8.x86_64.rpm
  • Uninstall podman if installed and then install the docker repo:
sudo dnf remove podman -y
sudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
  • Now get a list of available versions to choose from:
sudo dnf list docker-ce --showduplicates | sort -r

Now install the version (we went with the latest at the time of writing), enable and start docker:

sudo dnf install docker-ce-3:20.10.17-3.el8
sudo systemctl enable docker
sudo systemctl start docker

Clone the cnf-testsuite repository

  • Use git to pull down the source with:
git clone https://github.com/cncf/cnf-testsuite.git
  • Now cd into the cnf-testsuite directory and edit the shard.yml and update the ameba version to 1.0.1
cd cnf-testsuite/
vi shard.yml
  • And change the version line found for ameba 0.14.3:
development_dependencies:
  ameba:
    github: crystal-ameba/ameba
    version: ~> 0.14.3
  • to version 1.0.1:
development_dependencies:
  ameba:
    github: crystal-ameba/ameba
    version: ~> 1.0.1
  • Now you need to run shards to pull down and install the shards required for the testsuite:
shards install
  • You may see warnings about ameba not being compatible with crystal v1.5.0 but we have not seen any issues as of yet but shouldn't affect the testsuite as it's a linter.
  • Now if you see no other shards errors, you can build the cnf-testsuite binary:
crystal build src/cnf-testsuite.cr
  • You should now have a working binary unless you got compile errors. You can verify the binary by running ./cnf-testsuite version to print the version and then proceed with ./cnf-testsuite setup to run the setup and pre-req checks. Setup should tell you if you're missing any other required commands or binaries (kubectl, etc) that are outlined in INSTALL.md guide.

From that point on you can follow the quick install steps by clicking here.

Clone this wiki locally