[Fuego] [PATCH 4/7] kernel_build: use test_build instead of test_run

Daniel Sangorrin daniel.sangorrin at toshiba.co.jp
Tue Sep 4 08:41:08 UTC 2018


Using test_build allows to use variables from the board
and toolchain configuration such as ARCHITECTURE instead
of having to define them on the spec files.

Signed-off-by: Daniel Sangorrin <daniel.sangorrin at toshiba.co.jp>
---
 engine/tests/Functional.kernel_build/fuego_test.sh | 30 +++++++---------------
 engine/tests/Functional.kernel_build/spec.json     | 15 -----------
 engine/tests/Functional.kernel_build/test.yaml     | 14 +---------
 3 files changed, 10 insertions(+), 49 deletions(-)

diff --git a/engine/tests/Functional.kernel_build/fuego_test.sh b/engine/tests/Functional.kernel_build/fuego_test.sh
index 0722f5e..10c0d92 100755
--- a/engine/tests/Functional.kernel_build/fuego_test.sh
+++ b/engine/tests/Functional.kernel_build/fuego_test.sh
@@ -3,18 +3,11 @@ FUNCTIONAL_KERNEL_BUILD_PER_JOB_BUILD="true"
 function test_pre_check {
     echo "Doing a pre_check"
 
-    if [ "$NODE_NAME" != "docker" ]; then
-        abort_job "This test can only run on docker currently."
-    fi
-
-    if [ -z "$FUNCTIONAL_KERNEL_BUILD_ARCH" ]; then
-        FUNCTIONAL_KERNEL_BUILD_ARCH="x86_64"
-    fi
-
-    if [ "$FUNCTIONAL_KERNEL_BUILD_ARCH" = "x86_64" ]; then
-        is_on_sdk libelf.a LIBELF /usr/lib/$FUNCTIONAL_KERNEL_BUILD_ARCH-linux-*/
+    assert_define ARCHITECTURE
+    if [ "$ARCHITECTURE" = "x86_64" ]; then
+        is_on_sdk libelf.a LIBELF /usr/lib/$ARCHITECTURE-linux-*/
         assert_define LIBELF
-        is_on_sdk libssl.a LIBSSL /usr/lib/$FUNCTIONAL_KERNEL_BUILD_ARCH-linux-*/
+        is_on_sdk libssl.a LIBSSL /usr/lib/$ARCHITECTURE-linux-*/
         assert_define LIBSSL
         is_on_sdk bison PROGRAM_BISON /usr/bin/
         assert_define PROGRAM_BISON
@@ -27,7 +20,7 @@ function test_pre_check {
     fi
 }
 
-function test_run {
+function test_build {
     # make sure we have the latest source code.
     cd "$WORKSPACE/$JOB_BUILD_DIR"
     if [ -d ".git" ]; then
@@ -59,25 +52,20 @@ function test_run {
         FUNCTIONAL_KERNEL_BUILD_PARAMS="-j$(nproc)"
     fi
 
-    if [ ! -z "$FUNCTIONAL_KERNEL_BUILD_PLATFORM" ]; then
-          OLD_PLATFORM=$PLATFORM
-          PLATFORM=$FUNCTIONAL_KERNEL_BUILD_PLATFORM
-          source $FUEGO_RO/toolchains/tools.sh
-          PLATFORM=$OLD_PLATFORM
-    fi
-
-    make ARCH=$FUNCTIONAL_KERNEL_BUILD_ARCH $FUNCTIONAL_KERNEL_BUILD_PARAMS $FUNCTIONAL_KERNEL_BUILD_TARGET 2>&1 | tee build.log || true
+    make ARCH=$ARCHITECTURE $FUNCTIONAL_KERNEL_BUILD_PARAMS $FUNCTIONAL_KERNEL_BUILD_TARGET 2>&1 | tee build.log || true
 
     # cat on target populates the testlog with build.log
     report "cat $WORKSPACE/$JOB_BUILD_DIR/build.log"
+}
 
+function test_deploy {
     if [ -z "$FUNCTIONAL_KERNEL_DEPLOY" ]; then
         FUNCTIONAL_KERNEL_DEPLOY="$LOGDIR"
     fi
 
     # FIXTHIS: output the modules and dtbs as well
     echo "Deploying kernel to $FUNCTIONAL_KERNEL_DEPLOY"
-    cp $WORKSPACE/$JOB_BUILD_DIR/arch/$FUNCTIONAL_KERNEL_BUILD_ARCH/boot/*Image $FUNCTIONAL_KERNEL_DEPLOY
+    cp $WORKSPACE/$JOB_BUILD_DIR/arch/$ARCHITECTURE/boot/*Image $FUNCTIONAL_KERNEL_DEPLOY
 }
 
 function test_processing {
diff --git a/engine/tests/Functional.kernel_build/spec.json b/engine/tests/Functional.kernel_build/spec.json
index b2019ac..06df53d 100644
--- a/engine/tests/Functional.kernel_build/spec.json
+++ b/engine/tests/Functional.kernel_build/spec.json
@@ -5,19 +5,6 @@
             "gitrepo": "https://github.com/torvalds/linux.git",
             "config": "tinyconfig"
         },
-        "arm": {
-            "gitrepo": "https://github.com/torvalds/linux.git",
-            "platform": "debian-armhf",
-            "arch": "arm"
-        },
-        "arm64": {
-            "gitrepo": "https://github.com/torvalds/linux.git",
-            "platform": "aarch64",
-            "arch": "arm64",
-            "target": "Image dtbs modules",
-            "params": "-j8",
-            "regex_p": "^  OBJCOPY arch/arm64/boot/Image"
-        },
         "lts-414y": {
             "gitrepo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git",
             "gitref": "linux-4.14.y"
@@ -36,8 +23,6 @@
         "template": {
             "gitrepo": "https://xxx/yyy.git",
             "gitref": "my_tag_branch_or_commit_id",
-            "platform": "aarch64",
-            "arch": "arm64",
             "config": "defconfig",
             "target": "Image",
             "params": "-j8",
diff --git a/engine/tests/Functional.kernel_build/test.yaml b/engine/tests/Functional.kernel_build/test.yaml
index a462d3f..a8e53d5 100644
--- a/engine/tests/Functional.kernel_build/test.yaml
+++ b/engine/tests/Functional.kernel_build/test.yaml
@@ -2,9 +2,7 @@ fuego_package_version: 1
 name: Functional.kernel_build
 description: |
     Build the Linux kernel using various configurations, architectures and
-    versions. You must add the job to the docker node (e.g. ftc add-job
-    -b docker -t Functional.kernel_build -s arm64) and preinstall the
-    SDK/toolchain requirements in docker.
+    versions.
 license: GPL-2.0
 author: Linus Torvalds and thousands of collaborators
 maintainer: Daniel Sangorrin <daniel.sangorrin at toshiba.co.jp>
@@ -15,16 +13,6 @@ tags: ['linux', 'build']
 gitrepo: https://github.com/torvalds/linux.git
 host_dependencies: bison flex libelf-dev libssl-dev
 params:
-    - platform:
-        description: sdk/toolchain platform. Check <platform>-tools.sh in fuego-ro/toolchains
-        example: aarch64
-        optional: yes
-        default: docker board file's platform (x86_64)
-    - arch:
-        description: computer architecture
-        example: arm64
-        optional: yes
-        default: x86_64
     - config:
         description: |
             configuration option (e.g. defconfig or tinyconfig) or the absolute
-- 
2.7.4



More information about the Fuego mailing list