Merge "Create a test for GKI KMI compatibility" am: dfbbfab539 am: 0deaac3ac1 am: b46dda7171

Original change: https://android-review.googlesource.com/c/platform/development/+/1882028

Change-Id: I699153a6ff184cb56c621260ecc5338e627f8bab
This commit is contained in:
Isaac Chen
2021-11-08 07:10:47 +00:00
committed by Automerger Merge Worker
3 changed files with 97 additions and 0 deletions

29
gki/Android.bp Normal file
View File

@@ -0,0 +1,29 @@
//
// Copyright (C) 2021 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package {
default_applicable_licenses: ["development_license"],
}
sh_test {
name: "kmi_comp_test",
src: "run-script-test.sh",
filename: "run-script-test.sh",
test_config: "script_test.xml",
data: [
"kmi_abi_chk/prebuilts/kmi_sym-a12-5.4-7855344.ko",
"kmi_abi_chk/prebuilts/kmi_sym-a12-5.10-7833008.ko",
],
}

41
gki/run-script-test.sh Executable file
View File

@@ -0,0 +1,41 @@
#
# Copyright (C) 2021 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Default to Linux version 5.10
LINUX_VER=5.10
# The only other Linux version supported is 5.4.
uname -r | grep ^5.4
if [ $? -eq 0 ]; then
LINUX_VER=5.4
fi
# Unload test kernel module
su root insmod /data/local/tmp/kmi_sym-a12-$LINUX_VER.ko
if [ $? -ne 0 ]; then
echo "Failed to load the test kernel module!"
su root dmesg | grep kmi_sym: | tail -21 >&2
exit 1
fi
# Unload test kernel module
su root rmmod kmi_sym
if [ $? -ne 0 ]; then
echo "Failed to unload the test kernel module!"
su root dmesg | tail -21 >&2
exit 1
fi
exit 0

27
gki/script_test.xml Normal file
View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2021 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<configuration description="Runs kmi_comp_test">
<target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
<option name="cleanup" value="true" />
<option name="push" value="run-script-test.sh->/data/local/tmp/run-script-test.sh" />
<option name="push" value="kmi_sym-a12-5.4-7855344.ko->/data/local/tmp/kmi_sym-a12-5.4.ko" />
<option name="push" value="kmi_sym-a12-5.10-7833008.ko->/data/local/tmp/kmi_sym-a12-5.10.ko" />
</target_preparer>
<test class="com.android.tradefed.testtype.binary.ExecutableTargetTest" >
<option name="test-command-line" key="kmi_comp_test" value="/data/local/tmp/run-script-test.sh" />
</test>
</configuration>