summaryrefslogtreecommitdiffstats
path: root/recipes-containers/cri-o/files
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-containers/cri-o/files')
-rw-r--r--recipes-containers/cri-o/files/0001-Add-trimpath-to-build-nri.test.patch28
-rw-r--r--recipes-containers/cri-o/files/0001-Makefile-introduce-GO_TEST-for-more-flexible-configu.patch41
-rw-r--r--recipes-containers/cri-o/files/run-ptest11
3 files changed, 80 insertions, 0 deletions
diff --git a/recipes-containers/cri-o/files/0001-Add-trimpath-to-build-nri.test.patch b/recipes-containers/cri-o/files/0001-Add-trimpath-to-build-nri.test.patch
new file mode 100644
index 00000000..c26e58fd
--- /dev/null
+++ b/recipes-containers/cri-o/files/0001-Add-trimpath-to-build-nri.test.patch
@@ -0,0 +1,28 @@
1From 0bf230f59d211044e7993543e010b0d7f9dcead3 Mon Sep 17 00:00:00 2001
2From: Peng Zhang <peng.zhang1.cn@windriver.com>
3Date: Fri, 25 Oct 2024 10:42:02 +0800
4Subject: [PATCH] Add --trimpath to build nri.test
5
6when build test-binary, TMPDIR[buildpaths] error found in nri.test
7to fix this error, add "--trimpath" option to build nri.test.
8
9Upstream-Status: Inappropriate [oe specific]
10
11Signed-off-by: Peng Zhang <peng.zhang1.cn@windriver.com>
12---
13 Makefile | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16Index: cri-o-1.31.4+git33d75981bee230f791709975125d7386fe2c530a/src/import/Makefile
17===================================================================
18--- cri-o-1.31.4+git33d75981bee230f791709975125d7386fe2c530a.orig/src/import/Makefile
19+++ cri-o-1.31.4+git33d75981bee230f791709975125d7386fe2c530a/src/import/Makefile
20@@ -213,7 +213,7 @@
21 $(GO_BUILD) $(GCFLAGS) $(GO_LDFLAGS) -tags "$(BUILDTAGS)" -o $@ ./test/checkcriu
22
23 test/nri/nri.test: $(wildcard test/nri/*.go) ## Build the NRI test binary.
24- $(GO) test --tags "test $(BUILDTAGS)" -c ./test/nri -o $@
25+ $(GO) test --tags "test $(BUILDTAGS)" -c ./test/nri -o $@ ${TRIMPATH}
26
27 bin/crio: $(GO_FILES) ## Build the CRI-O main binary.
28 $(GO_BUILD) $(GCFLAGS) $(GO_LDFLAGS) -tags "$(BUILDTAGS)" -o $@ ./cmd/crio
diff --git a/recipes-containers/cri-o/files/0001-Makefile-introduce-GO_TEST-for-more-flexible-configu.patch b/recipes-containers/cri-o/files/0001-Makefile-introduce-GO_TEST-for-more-flexible-configu.patch
new file mode 100644
index 00000000..33c65b5a
--- /dev/null
+++ b/recipes-containers/cri-o/files/0001-Makefile-introduce-GO_TEST-for-more-flexible-configu.patch
@@ -0,0 +1,41 @@
1From 656cb24b07b1e5b63939c15dc31d8c9839ecce75 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Tue, 14 Jan 2025 20:55:50 -0800
4Subject: [PATCH] Makefile: introduce GO_TEST for more flexible configuration
5
6Introduce GO_TEST and make it similar to GO_BUILD.
7
8Note that with this change, the default behavior changes a little bit,
9that is, TRIMPATH, GCFLAGS and GO_LDFALGS all have effect on test/nri/nri.test.
10
11Upstream-Status: Submitted [https://github.com/cri-o/cri-o/pull/8912]
12
13Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
14---
15 Makefile | 3 ++-
16 1 file changed, 2 insertions(+), 1 deletion(-)
17
18diff --git a/Makefile b/Makefile
19index 34f9d429d..f02213894 100644
20--- a/Makefile
21+++ b/Makefile
22@@ -3,6 +3,7 @@ GO ?= go
23 TRIMPATH ?= -trimpath
24 GO_ARCH=$(shell $(GO) env GOARCH)
25 GO_BUILD ?= $(GO) build $(TRIMPATH)
26+GO_TEST ?= $(GO) test $(TRIMPATH)
27 GO_RUN ?= $(GO) run
28 NIX_IMAGE ?= nixos/nix:2.24.3
29
30@@ -213,7 +214,7 @@ test/checkcriu/checkcriu: $(GO_FILES) ## Build the checkcriu test binary.
31 $(GO_BUILD) $(GCFLAGS) $(GO_LDFLAGS) -tags "$(BUILDTAGS)" -o $@ ./test/checkcriu
32
33 test/nri/nri.test: $(wildcard test/nri/*.go) ## Build the NRI test binary.
34- $(GO) test --tags "test $(BUILDTAGS)" -c ./test/nri -o $@
35+ $(GO_TEST) $(GCFLAGS) $(GO_LDFLAGS) --tags "test $(BUILDTAGS)" -c ./test/nri -o $@
36
37 bin/crio: $(GO_FILES) ## Build the CRI-O main binary.
38 $(GO_BUILD) $(GCFLAGS) $(GO_LDFLAGS) -tags "$(BUILDTAGS)" -o $@ ./cmd/crio
39--
402.25.1
41
diff --git a/recipes-containers/cri-o/files/run-ptest b/recipes-containers/cri-o/files/run-ptest
new file mode 100644
index 00000000..62abe959
--- /dev/null
+++ b/recipes-containers/cri-o/files/run-ptest
@@ -0,0 +1,11 @@
1#!/bin/sh
2
3./test/test_runner.sh | while IFS= read -r line; do
4 if [[ $line =~ ^not\ ok ]]; then
5 echo "FAIL: ${line#not ok }"
6 elif [[ $line =~ ^ok && ! $line =~ \#\ skip ]]; then
7 echo "PASS: ${line#ok }"
8 elif [[ $line =~ ^ok.*#\ skip ]]; then
9 echo "SKIP: ${line#ok }"
10 fi
11done