Uploaded image for project: 'DC/OS'
  1. DC/OS
  2. DCOS_OSS-3620

dcos-test-utils: Log stderr on failing command execution

    Details

    • Sprint:
      Security Team Sprint 32, Security Team Sprint 33
    • Story Points:
      3

      Description

      dcos-test-utils does not log stderr when a command fails, making it difficult to debug the problem:

      E               subprocess.CalledProcessError: Command '['dcos', 'package', 'install', 'dcos-enterprise-cli', '--cli', '--global', '--yes']' returned non-zero exit status 1.
      
      ../python--057e5852ce27b59f8c18459cb368c58190757c61/lib/python3.6/subprocess.py:418: CalledProcessError
      ----------------------------------------------------------------------------------------------------- Captured stderr setup -----------------------------------------------------------------------------------------------------
      [2018-06-12 08:14:34,474|root|INFO]: Verifying secret store is in default state
      [2018-06-12 08:14:34,475|dcos_test_utils.helpers|DEBUG]: Request method GET: https://172.17.0.2/secrets/v1/seal-status/default. Arguments: {}
      [2018-06-12 08:14:34,476|urllib3.connectionpool|DEBUG]: Starting new HTTPS connection (1): 172.17.0.2
      [2018-06-12 08:14:34,505|urllib3.connectionpool|DEBUG]: https://172.17.0.2:443 "GET /secrets/v1/seal-status/default HTTP/1.1" 200 55
      [2018-06-12 08:14:34,506|dcos_test_utils.helpers|DEBUG]: Request method GET: https://172.17.0.2/secrets/v1/store. Arguments: {}
      [2018-06-12 08:14:34,507|urllib3.connectionpool|DEBUG]: Starting new HTTPS connection (1): 172.17.0.2
      [2018-06-12 08:14:34,513|urllib3.connectionpool|DEBUG]: https://172.17.0.2:443 "GET /secrets/v1/store HTTP/1.1" 200 164
      [2018-06-12 08:14:34,514|dcos_test_utils.helpers|DEBUG]: Request method GET: https://172.17.0.2/secrets/v1/secret/default/?list=true. Arguments: {}
      [2018-06-12 08:14:34,515|urllib3.connectionpool|DEBUG]: Starting new HTTPS connection (1): 172.17.0.2
      [2018-06-12 08:14:34,519|urllib3.connectionpool|DEBUG]: https://172.17.0.2:443 "GET /secrets/v1/secret/default/?list=true HTTP/1.1" 200 13
      [2018-06-12 08:14:34,521|dcos_test_utils.helpers|DEBUG]: Request method GET: https://172.17.0.2/marathon/v2/groups/. Arguments: {}
      [2018-06-12 08:14:34,522|urllib3.connectionpool|DEBUG]: Starting new HTTPS connection (1): 172.17.0.2
      [2018-06-12 08:14:34,585|urllib3.connectionpool|DEBUG]: https://172.17.0.2:443 "GET /marathon/v2/groups/ HTTP/1.1" 200 None
      [2018-06-12 08:14:34,588|urllib3.connectionpool|DEBUG]: Starting new HTTPS connection (1): downloads.dcos.io
      [2018-06-12 08:14:35,984|urllib3.connectionpool|DEBUG]: https://downloads.dcos.io:443 "GET /binaries/cli/linux/x86-64/dcos-1.11/dcos HTTP/1.1" 200 14704840
      [2018-06-12 08:15:03,125|dcos_test_utils.dcos_cli|INFO]: CMD: ['dcos', 'cluster', 'setup', 'https://172.17.0.2', '--no-check', '--username=admin', '--password=admin']
      [2018-06-12 08:15:04,607|dcos_test_utils.dcos_cli|INFO]: STDOUT: 
      [2018-06-12 08:15:04,608|dcos_test_utils.dcos_cli|INFO]: STDERR: 
      [2018-06-12 08:15:04,608|dcos_test_utils.dcos_cli|INFO]: CMD: ['dcos', 'package', 'install', 'dcos-enterprise-cli', '--cli', '--global', '--yes']
      

      Note that the successful command logs stdout and stderr, but the failing command does not, even though that is when logging is most useful.

        Attachments

          Activity

            People

            • Assignee:
              jonathangiddy Jonathan Giddy
              Reporter:
              jonathangiddy Jonathan Giddy
              Team:
              Security Team
              Watchers:
              Jan-Philip Gehrcke, Jonathan Giddy
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: