How can I test my SDK extension?#

How can I test my SDK extension?

I have a new or changed SDK extension, how can I test it?

Run against the base SDK

You will need to run your test with the base SDK (simplecore-simpleswitch-sdk).

First create a new test case at lib/oeqa/sdk/cases/mytest.py with the following content

from oeqa.extensions.helper import SimpleCoreTestExtensions
from oeqa.sdk.case import OESDKTestCase


class SimpleSwitch_SDKTests_MyTest(OESDKTestCase):
   def setUp(self):
      """Check preconditions."""
      self._version = os.environ.get('OECORE_SDK_VERSION', 'latest')
      if self._version == '0.1.0':
            self._version = 'latest'

   def test_simpleswitch_mytest_package(self):
      SimpleCoreTestExtensions.sdk.install_extension(self, 'mysdk', self._version)

mysdk is the value of SIMPLESWITCH_SDK_EXTENSION_NAME you set.

Next build your base SDK and your extension

$ scotty build simplecore-simpleswitch-sdk simpleswitch-sdk-ext-mytest -c populate_sdk

Now you can then run tests against the the base SDK + the requested extension, using the guide at How can I test my changes to the SDK test cases?