Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit or integration tests #24

Closed
LK4D4 opened this issue Dec 15, 2015 · 2 comments
Closed

Add unit or integration tests #24

LK4D4 opened this issue Dec 15, 2015 · 2 comments
Milestone

Comments

@LK4D4
Copy link
Contributor

LK4D4 commented Dec 15, 2015

No description provided.

@crosbymichael crosbymichael modified the milestone: beta Dec 15, 2015
@siennathesane
Copy link

I was looking through this project, and I'd like to assist a bit. I guess a good place to get started would be with some tests. Do you have a good/recommended starting location or package you'd like to start with?

@mlaventure
Copy link
Contributor

@mynameismevin unit tests can be done using the builtin test framework from Go.

Please feel free to make a PR for some unit tests if you're still interested :)

jepio pushed a commit to jepio/containerd that referenced this issue Dec 3, 2021
jseba pushed a commit to jseba/containerd that referenced this issue Aug 25, 2023
move all rpm build deps into spec file
jseba pushed a commit to jseba/containerd that referenced this issue Aug 25, 2023
It looks like `ca-certificates` is not up-to-date in the base-images, and is not
updated as part of installing the build-dependencies, causing failiures when
trying to build with Go 1.15 and Go 1.16 (for some reason, it didn't fail when
using Go 1.13?):

First, make sure that the images are up to date;

    $ docker pull docker.io/library/golang:1.16
    1.16: Pulling from library/golang
    Digest: sha256:c9c3bd7c5cb8e58c1b2d15bb0cd7e43569f920659f71a4a993ca534ee185a1b4
    Status: Image is up to date for golang:1.16
    docker.io/library/golang:1.16

    $ docker pull docker.io/library/ubuntu:bionic
    bionic: Pulling from library/ubuntu
    Digest: sha256:4bc3ae6596938cb0d9e5ac51a1152ec9dcac2a1c50829c74abd9c4361e321b26
    Status: Image is up to date for ubuntu:bionic
    docker.io/library/ubuntu:bionic

Build the `build-env` target, and start a container from that;

    $ docker build -t foo --target=build-env --build-arg BUILD_IMAGE=docker.io/library/ubuntu:bionic --build-arg GOLANG_IMAGE=docker.io/library/golang:1.16 -f dockerfiles/deb.dockerfile .
    $ docker run -it --rm foo bash

Inside container:

    $ git clone https://github.com/opencontainers/runc.git /go/src/github.com/opencontainers/runc/
    Cloning into '/go/src/github.com/opencontainers/runc'...
    fatal: unable to access 'https://github.com/opencontainers/runc.git/': Problem with the SSL CA cert (path? access rights?)

A similar error was produced when building;

    containerd#24 89.76 + pwd
    containerd#24 89.76 + make -C /go/src/github.com/opencontainers/runc --no-print-directory BINDIR=/root/containerd/bin BUILDTAGS=seccomp apparmor selinux runc install
    containerd#24 89.92 go build -trimpath "-buildmode=pie"  -tags "seccomp apparmor selinux" -ldflags "-X main.gitCommit="59ad417c14143ae6b34e9cf88cf3f6e9c6d5f9e8" -X main.version=1.0.0-rc93+dev " -o runc .
    containerd#24 90.60 go: github.com/checkpoint-restore/go-criu/[email protected]: Get https://proxy.golang.org/github.com/checkpoint-restore/go-criu/v4/@v/v4.1.0.mod: x509: certificate signed by unknown authority
    containerd#24 90.61 make[2]: *** [runc] Error 1
    containerd#24 90.61 Makefile:32: recipe for target 'runc' failed

After installing/updating `ca-certificates`;

    $ apt-get update && apt-get install ca-certificates
    $ git clone https://github.com/opencontainers/runc.git /go/src/github.com/opencontainers/runc/
    Cloning into '/go/src/github.com/opencontainers/runc'...

Narrowing down the problem by running the `ubuntu:bionic` without the additional
steps/scripts performed in the repository showed the same problem;

    $ docker run -it --rm docker.io/library/ubuntu:bionic

    $ apt-get update -q && apt-get install -y --no-install-recommends \
        curl \
        devscripts \
        equivs \
        git \
        lsb-release \
     && rm -rf /var/lib/apt/lists/*

    $ git clone https://github.com/opencontainers/runc.git /go/src/github.com/opencontainers/runc/
    Cloning into '/go/src/github.com/opencontainers/runc'...
    fatal: unable to access 'https://github.com/opencontainers/runc.git/': Problem with the SSL CA cert (path? access rights?)

And again, after installing/updating `ca-certificates`;

    $ apt-get update && apt-get install ca-certificates
    $ git clone https://github.com/opencontainers/runc.git /go/src/github.com/opencontainers/runc/
    Cloning into '/go/src/github.com/opencontainers/runc'...
    remote: Enumerating objects: 19, done.
    remote: Counting objects: 100% (19/19), done.
    remote: Compressing objects: 100% (15/15), done.
    remote: Total 27482 (delta 5), reused 13 (delta 3), pack-reused 27463
    Receiving objects: 100% (27482/27482), 11.59 MiB | 5.87 MiB/s, done.
    Resolving deltas: 100% (17969/17969), done.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants