From 47659db192f1c397a906babc79edea7f7ec6c8cf Mon Sep 17 00:00:00 2001 From: Yeoh Ee Peng Date: Wed, 1 Apr 2020 14:50:32 +0800 Subject: runtime/libxcam: Enable sanity test Enable sanity tests: - test libxcam soft sample app can perform image remap using libxcam library Signed-off-by: Yeoh Ee Peng Signed-off-by: Anuj Mittal --- lib/oeqa/runtime/cases/libxcam.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 lib/oeqa/runtime/cases/libxcam.py (limited to 'lib/oeqa') diff --git a/lib/oeqa/runtime/cases/libxcam.py b/lib/oeqa/runtime/cases/libxcam.py new file mode 100644 index 00000000..57192f07 --- /dev/null +++ b/lib/oeqa/runtime/cases/libxcam.py @@ -0,0 +1,37 @@ +from oeqa.runtime.case import OERuntimeTestCase +from oeqa.runtime.decorator.package import OEHasPackage +from oeqa.core.decorator.depends import OETestDepends + +class LibxcamTest(OERuntimeTestCase): + yuv_file = 'vtest.yuv' + soft_test_app_file = 'test-soft-image' + libxcam_test_app_dir = '/usr/bin/libxcam/' + libxcam_file_dir = '/tmp/' + + @classmethod + def tearDownClass(cls): + cls.tc.target.run("rm %s%s" % (cls.libxcam_file_dir, cls.yuv_file)) + + @OEHasPackage(['gstreamer1.0-plugins-base']) + @OEHasPackage(['gstreamer1.0-plugins-good']) + @OEHasPackage(['gstreamer1.0-vaapi']) + @OEHasPackage(['intel-vaapi-driver']) + def test_libxcam_can_generate_yuv_file_with_gstreamer(self): + (status, output) = self.target.run('gst-inspect-1.0 vaapi') + self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output)) + + (status, output) = self.target.run('gst-launch-1.0 -ev videotestsrc num-buffers=60 ! ' + 'timeoverlay ! filesink location=%s%s' % + (self.libxcam_file_dir, self.yuv_file)) + self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output)) + + @OEHasPackage(['libxcam']) + @OEHasPackage(['libxcam-test']) + @OETestDepends(['libxcam.LibxcamTest.test_libxcam_can_generate_yuv_file_with_gstreamer']) + def test_libxcam_can_execute_soft_image_sample_app(self): + (status, output) = self.target.run('%s%s --type remap --input0 %s%s --output soft_out.nv12 --save false' % + (self.libxcam_test_app_dir, + self.soft_test_app_file, + self.libxcam_file_dir, + self.yuv_file)) + self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output)) -- cgit v1.2.3-54-g00ecf