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