-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add bors + buildbot support, and legal stuff
- Loading branch information
Showing
7 changed files
with
130 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
build_dir="$(pwd)/build" | ||
src_dir="$(pwd)" | ||
cheri_dir="/home/buildbot/cheri/output" | ||
|
||
# Build project locally | ||
export CC=$cheri_dir/morello-sdk/bin/clang | ||
export CFLAGS="--config cheribsd-morello-hybrid.cfg" | ||
export ASMFLAGS="--config cheribsd-morello-hybrid.cfg" | ||
|
||
cmake \ | ||
-G Ninja \ | ||
-DCMAKE_BUILD_TYPE=DEBUG \ | ||
-DLLVM_DIR=$cheri_dir/morello-sdk/lib/cmake/llvm \ | ||
-DClang_DIR=$cheri_dir/morello-sdk/lib/cmake/clang \ | ||
-B $build_dir \ | ||
-S $src_dir | ||
cmake --build $build_dir | ||
|
||
# Set arguments for Morello hybrid instance | ||
export SSHPORT=10086 | ||
export PYTHONPATH="/home/buildbot/build/test-scripts" | ||
|
||
args=( | ||
--architecture morello-hybrid | ||
# Qemu System to use | ||
--qemu-cmd $cheri_dir/morello-sdk/bin/qemu-system-morello | ||
--bios edk2-aarch64-code.fd | ||
--disk-image $cheri_dir/cheribsd-morello-hybrid.img | ||
# Required build-dir in CheriBSD | ||
--build-dir . | ||
--ssh-port $SSHPORT | ||
--ssh-key $HOME/.ssh/id_ed25519.pub | ||
) | ||
|
||
# Spawn CHERI QEMU instance, then execute `ctest` | ||
python3 $src_dir/.run_cheri_qemu_and_test.py "${args[@]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Adapted from | ||
# https://github.com/capablevms/cheri-examples/blob/master/tests/run_cheri_examples.py | ||
|
||
import argparse | ||
import importlib.util | ||
import os | ||
import subprocess | ||
import sys | ||
|
||
from pathlib import Path | ||
|
||
# Emulate `sys.path` from path of module `run_tests_common` (found via | ||
# environment variable `PYTHONPATH`), as required by the CHERI testing | ||
# infrastructure which we are using to simplify booting a QEMU instance | ||
test_scripts_dir = str(Path(importlib.util.find_spec("run_tests_common").origin).parent.absolute()) | ||
sys.path = sys.path[sys.path.index(test_scripts_dir):] | ||
|
||
from run_tests_common import boot_cheribsd, run_tests_main | ||
|
||
def run_tests(qemu: boot_cheribsd.QemuCheriBSDInstance, args: argparse.Namespace) -> bool: | ||
if args.sysroot_dir is not None: | ||
boot_cheribsd.set_ld_library_path_with_sysroot(qemu) | ||
boot_cheribsd.info("Running tests for cheri-morello-compartmentalisation") | ||
|
||
# Run command on host to test the executed client | ||
os.chdir(f"{args.build_dir}/build") | ||
subprocess.run(["/usr/bin/ctest", "-V"], check=True) | ||
return True | ||
|
||
if __name__ == '__main__': | ||
# This call has the side-effect of booting a QEMU instance | ||
run_tests_main(test_function=run_tests, need_ssh=True, should_mount_builddir=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Except as otherwise noted (below and/or in individual files), this project is | ||
licensed under the Apache License, Version 2.0 <LICENSE-APACHE> | ||
<http://www.apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT> | ||
<http://opensource.org/licenses/MIT>, at your option. | ||
|
||
Copyright is retained by contributors and/or the organisations they | ||
represent(ed) -- this project does not require copyright assignment. Please see | ||
version control history for a full list of contributors. Note that some files | ||
may include explicit copyright and/or licensing notices. | ||
|
||
The following contributors wish to explicitly make it known that the copyright | ||
of their contributions is retained by an organisation: | ||
|
||
Jacob Bramley <[email protected]>: | ||
copyright retained by Arm Limited | ||
Laurence Tratt <[email protected]>: | ||
copyright retained by King's College London |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
this software and associated documentation files (the "Software"), to deal in | ||
the Software without restriction, including without limitation the rights to | ||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | ||
of the Software, and to permit persons to whom the Software is furnished to do | ||
so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Sourced from | ||
# https://github.com/capablevms/cheri-examples/blob/master/bors.toml | ||
status = ["buildbot/capablevms-test-script"] | ||
|
||
timeout_sec = 600 # 10 minutes | ||
|
||
# Have bors delete auto-merged branches | ||
delete_merged_branches = true | ||
|
||
cut_body_after = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters