xref: /OK3568_Linux_fs/yocto/poky/meta/lib/oeqa/sdk/buildtools-cases/https.py (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1#
2# SPDX-License-Identifier: MIT
3#
4
5from oeqa.sdk.case import OESDKTestCase
6from oeqa.utils.subprocesstweak import errors_have_output
7errors_have_output()
8
9class HTTPTests(OESDKTestCase):
10    """
11    Verify that HTTPS certificates are working correctly, as this depends on
12    environment variables being set correctly.
13    """
14
15    def test_wget(self):
16        self._run('env -i wget --debug --output-document /dev/null https://yoctoproject.org/connectivity.html')
17
18    def test_python(self):
19        # urlopen() returns a file-like object on success and throws an exception otherwise
20        self._run('python3 -c \'import urllib.request; urllib.request.urlopen("https://yoctoproject.org/connectivity.html")\'')
21