[OE-core] [PATCHv2 4/4] oeqa/sdkext: Add sdk_update.SDKUpdateTest class.

Paul Eggleton paul.eggleton at linux.intel.com
Thu Feb 25 00:22:23 UTC 2016


Hi Aníbal,

On Mon, 22 Feb 2016 12:31:33 Aníbal Limón wrote:
> From: Aníbal Limón <limon.anibal at gmail.com>
> 
> The SDKUpdateTest class test devtool sdk-update mechanism inside
> eSDK.
> 
> The SDKUpdateTest class search for new sdk if not found uses
> the main one then it publish the eSDK into known folder
> inside work and it starts a web server for serve the eSDK.
> 
> Finally it executes sdk-update over http, the local test is
> commented due to bug [1].
> 
> [1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=9043
> 
> [YOCTO #9089]
> 
> Signed-off-by: Aníbal Limón <limon.anibal at gmail.com>
> ---
>  meta/lib/oeqa/sdkext/sdk_update.py | 39
> ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+)
>  create mode 100644 meta/lib/oeqa/sdkext/sdk_update.py
> 
> diff --git a/meta/lib/oeqa/sdkext/sdk_update.py
> b/meta/lib/oeqa/sdkext/sdk_update.py new file mode 100644
> index 0000000..16f5b10
> --- /dev/null
> +++ b/meta/lib/oeqa/sdkext/sdk_update.py
> @@ -0,0 +1,39 @@
> +import os
> +import shutil
> +import subprocess
> +
> +from oeqa.oetest import oeSDKExtTest
> +from oeqa.utils.httpserver import HTTPService
> +
> +class SdkUpdateTest(oeSDKExtTest):
> +
> +    @classmethod
> +    def setUpClass(self):
> +        self.publish_dir = os.path.join(self.tc.sdktestdir, 'esdk_publish')
> +        if os.path.exists(self.publish_dir):
> +            shutil.rmtree(self.publish_dir)
> +        os.mkdir(self.publish_dir)
> +
> +        tcname_new = self.tc.d.expand(
> +            "${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}-new.sh")
> +        if not os.path.exists(tcname_new):
> +            tcname_new = self.tc.tcname
> +
> +        cmd = 'oe-publish-sdk %s %s' % (tcname_new, self.publish_dir)
> +        subprocess.check_output(cmd, shell=True)
> +
> +        self.http_service = HTTPService(self.publish_dir)
> +        self.http_service.start()
> +
> +        self.http_url = "http://127.0.0.1:%d" % self.http_service.port
> +
> +    def test_sdk_update_http(self):
> +        output = self._run("devtool sdk-update \"%s\"" % self.http_url)
> +
> +#    def test_sdk_update_local(self):
> +#        output = self._run("devtool sdk-update \"%s\"" % self.publish_dir)
> +
> +    @classmethod
> +    def tearDownClass(self):
> +        self.http_service.stop()
> +        shutil.rmtree(self.publish_dir)

You're testing invocation of the sdk-update command, but nothing much beyond 
that - the update isn't going to be doing anything here since nothing will 
have changed. However since this would involve modifying the metadata though I 
guess that may have to be done as an oe-selftest test.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



More information about the Openembedded-core mailing list