Hi Alex,

"remote-test-server" on qemu-image with a tap interface throws an error.
The emulators for rust testing are with tcp port forwarding so used
slirp method with added rust port.

References:
https://github.com/rust-lang/rust/issues/33114
https://github.com/rust-lang/rust/blob/master/src/tools/remote-test-client/src/main.rs

Regards,
Vinay


Regards,
Vinay

On Mon, May 17, 2021 at 4:30 PM Alexander Kanavin
<[email protected]> wrote:
>
> Is slirp really required? Is it possible to use the standard tap setup 
> instead?
>
> Alex
>
> On Mon, 17 May 2021 at 12:35, Vinay Kumar <[email protected]> wrote:
>>
>> The rust test involves qemuimage for testing, so
>> "run_check_emulated" involves building of "remote-test-server",
>> qemuimage and test execution.
>>
>> We are booting qemuimage in "nographic" and "slirp" mode along with
>> additional qemuparams,
>> '-monitor telnet:127.0.0.1:1234,server,nowait -serial mon:stdio -serial null'
>>
>> Note:
>> '-serial mon:stdio -serial' :  To fix below run-time errors while testing
>> "failed with Connection reset by peer"
>>
>> Signed-off-by: Vinay Kumar <[email protected]>
>> ---
>>  meta/lib/oeqa/selftest/cases/rust.py | 32 ++++++++++++++++++++++++++++
>>  1 file changed, 32 insertions(+)
>>  create mode 100644 meta/lib/oeqa/selftest/cases/rust.py
>>
>> diff --git a/meta/lib/oeqa/selftest/cases/rust.py 
>> b/meta/lib/oeqa/selftest/cases/rust.py
>> new file mode 100644
>> index 0000000000..4efbf9306f
>> --- /dev/null
>> +++ b/meta/lib/oeqa/selftest/cases/rust.py
>> @@ -0,0 +1,32 @@
>> +# SPDX-License-Identifier: MIT
>> +import os
>> +from oeqa.core.decorator import OETestTag
>> +from oeqa.core.case import OEPTestResultTestCase
>> +from oeqa.selftest.case import OESelftestTestCase
>> +from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars, runqemu, 
>> Command
>> +
>> +class RustSelfTestBase(OESelftestTestCase, OEPTestResultTestCase):
>> +
>> +       def run_check_emulated(self, *args, **kwargs):
>> +               # build remote-test-server before image build
>> +               recipe = "rust-testsuite"
>> +               bitbake("{} -c compile".format(recipe))
>> +
>> +               # build core-image-minimal with required packages
>> +               default_installed_packages = ["libgcc", "libstdc++", 
>> "libatomic", "libgomp"]
>> +               features = []
>> +               features.append('IMAGE_FEATURES += "ssh-server-openssh"')
>> +               features.append('CORE_IMAGE_EXTRA_INSTALL += "{0}"'.format(" 
>> ".join(default_installed_packages)))
>> +               self.write_config("\n".join(features))
>> +               bitbake("core-image-minimal")
>> +               # wrap the execution with a qemu instance
>> +               with runqemu("core-image-minimal", runqemuparams = 
>> "nographic slirp", qemuparams= " -monitor \
>> +                        telnet:127.0.0.1:1234,server,nowait -serial 
>> mon:stdio -serial null") as qemu:
>> +                       recipe = "rust-testsuite"
>> +                       bitbake("{} -c check".format(recipe))
>> +
>> +
>> +@OETestTag("toolchain-system")
>> +class RustSelfTestSystemEmulated(RustSelfTestBase):
>> +       def test_rust(self):
>> +               self.run_check_emulated("rust")
>> --
>> 2.17.1
>>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#151932): 
https://lists.openembedded.org/g/openembedded-core/message/151932
Mute This Topic: https://lists.openembedded.org/mt/82883381/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to