Skip to content

Commit

Permalink
Merge pull request #1 from nvidia-holoscan/import
Browse files Browse the repository at this point in the history
Initial support for Clara AGX and IGX Orin DevKits
  • Loading branch information
p-ogrady authored Mar 14, 2023
2 parents 331c80b + b4f1361 commit 4bd5f9c
Show file tree
Hide file tree
Showing 54 changed files with 5,216 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__pycache__
*.pyc
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Holoscan Test Suite is released on GitHub to facilitate customers' validation of deployed systems.

Please report issues using GitHub [Issues](https://github.com/nvidia-holoscan/holoscan-test-suite/issues).
3 changes: 2 additions & 1 deletion LICENSE → LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Expand Down Expand Up @@ -186,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2023, NVIDIA Corporation.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
6 changes: 6 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Holoscan Test Suite Open Source Software
Copyright (c) 2022-2023, NVIDIA CORPORATION.

This product includes software developed at
NVIDIA CORPORATION (https://www.nvidia.com/),
and is available under the Apache-2.0 license.
104 changes: 104 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@

holoscan-test-suite provides a very simple web server that runs test scripts and
publishes the results as HTML back to the calling browser.

holoscan-test-controls leverages tools in holoscan-test-suite to provide an
interactive web UI to enable various runtime behaviors on demand. This is
useful in the context of, say, EMR or thermal characterization: you can start
with a quiet system, measure RF emissions, then gradually turn on features, and
easily observe the differences with specific functionality running.

Requirements for this interface include:

- Provide device and configuration identification sufficient for complete
reproduction of the configuration under test.
- Provide a record of when the test was run.
- Provide evidence of test execution with a summary of pass/fail status.
- Provide a record of the stdout/stderr generated by tests for debugging.
- Provide proper configuration for use with Yocto and Bitbake.

holoscan-test-suite works by configuring a simple python flask webserver to
wrap calls to pytest. Pytest is used to invoke specific tests, where each test
can (for example) call a bringup shell script. The entire test passes if all
the specific tests pass. A bringup script can exit with a nonzero exit code to
indicate a test failure. holoscan-test-suite accumulates the pass/fail status,
standard output, and standard error for each test and generates an HTML page
with these detailed results.

In the src directory, you'll find

- bringup\_(component)\_(configuration).sh

These shell scripts follow the design of the L4T bringup framework, and
return a 0 exit code on successful completion.

- test\_(configuration).py

This script adapts pytest to create test cases for each bringup script it
plans to execute. Any pytest-compliant test can be added here.

- (configuration)\_report.py

This module contains an "identify()" routine that returns a multi-level map
of name/value pairs with a complete list of the components found on the
system.

- flask\_wrapper.py

Serves to configure flask with all the test cases found in
test\_(configuration).py and displays appropriate pages with the
configuration report and test results (as appropriate). This script takes
two command-line parameters: the name of the module with the identify()
routine and the name of the pytest module (without the .py suffix):

python3 flask_wrapper (configuration)\_report test\_(configuration)

The web server is configured to listen on any local network interface on
TCP port 8765. Press control/C to terminate this application.

- run\_(configuration).sh

Runs flask\_wrapper with the approriate test and report scripts for the
given configuartion.

It's expected that run\_(configuration).sh would be started on boot
from a specially configured testing boot image.

Adding a new test is easy:

- Create a new bringup\_(component)\_(configuration).sh script, per the
L4T bringup framework guidelines.
- Add that script to test\_(configuration).py
- Kill and restart the run\_(configuration).sh script.

For Yocto applications, you can include testing by

- Clone this project into a directory next to meta-tegra-clara-holoscan-mgx.
From the build container's perspective, this will be in
/workspace/holoscan-test-suite.
- Add "/workspace/holoscan-test-suite/meta-holoscan-test-suite" to
build/conf/bblayers.conf
- Add "CORE\_IMAGE\_EXTRA\_INSTALL:append = " holoscan-test-suite"" to
build/conf/local.conf (don't forget the space after the double quote:
" holoscan-test-suite")

To add holoscan-test-controls,
- Add "/workspace/holoscan-test-suite/meta-holoscan-test-controls" to
build/conf/bblayers.conf
- Add "CORE\_IMAGE\_EXTRA\_INSTALL:append = " holoscan-test-controls"" to
build/conf/local.conf (don't forget the space after the double quote:
" holoscan-test-controls")

Then use your usual commands to build your image (e.g. bitbake.sh) and flash
your system (e.g. flash.sh).

With this, the server will start at boot; you can use your browser to run
holoscan-test-suite by going to "http://\<ip\>:8765"; if you've enabled
holoscan-test-controls, that is accessable by "http://\<ip\>:8767". You can
observe the console for holoscan-test-suite by running the command "screen -d -r
holoscan-test-suite", which may be useful when developing new tests. If you're
developing new tests, you may want to "systemctl stop holoscan-test-suite", then
you can directly execute "run\_(configuration).sh" in your shell. The console
for holoscan-test-controls is available by "screen -d -r
holoscan-test-controls".

18 changes: 18 additions & 0 deletions holoscan_test_suite/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# 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.

import os

default_test_image = os.path.join(os.path.dirname(__file__), "test_image.png")
Loading

0 comments on commit 4bd5f9c

Please sign in to comment.