[v2,12/12] CI: Add documentation for test case creation

Message ID 20230303144727.481716-13-amikan@ilbers.de
State Accepted, archived
Headers show
Series Next avocado improvements​ | expand

Commit Message

Anton Mikanovich March 3, 2023, 2:47 p.m. UTC
Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
 testsuite/README.md | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

Patch

diff --git a/testsuite/README.md b/testsuite/README.md
index 570ead9..476b860 100644
--- a/testsuite/README.md
+++ b/testsuite/README.md
@@ -93,3 +93,32 @@  can be executed instead of command:
 The default location of custom scripts is `isar/testsuite/`. It can be changed
 by passing `-p test_script_dir="custom_path"` to `avocado run`
 arguments.
+
+# Custom test case creation
+
+The minimal build test can be look like:
+
+```
+#!/usr/bin/env python3
+
+from cibase import CIBaseTest
+
+class SampleTest(CIBaseTest):
+    def test_sample(self):
+        self.init()
+        self.perform_build_test("mc:qemuamd64-bullseye:isar-image-base")
+```
+
+To show the list of available tests you can run:
+
+```
+$ avocado list sample.py
+avocado-instrumented sample.py:SampleTest.test_sample
+```
+
+And to execute this example:
+
+```
+$ avocado run sample.py:SampleTest.test_sample
+```
+