This file is indexed.

/usr/lib/python3/dist-packages/checkbox_ng/main.py is in python3-checkbox-ng 0.3.1-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# This file is part of Checkbox.
#
# Copyright 2012, 2013 Canonical Ltd.
# Written by:
#   Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
#
# Checkbox is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3,
# as published by the Free Software Foundation.

#
# Checkbox is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Checkbox.  If not, see <http://www.gnu.org/licenses/>.

"""
:mod:`checkbox_ng.main` -- command line interface
=================================================
"""

import logging
import sys

from plainbox.impl.commands import PlainBoxToolBase
from plainbox.impl.commands.check_config import CheckConfigCommand
from plainbox.impl.commands.dev import DevCommand
from plainbox.impl.commands.script import ScriptCommand

from checkbox_ng import __version__ as version
from checkbox_ng.commands.certification import CertificationCommand
from checkbox_ng.commands.cli import CliCommand
from checkbox_ng.commands.sru import SRUCommand
try:
    from checkbox_ng.commands.service import ServiceCommand
except ImportError:
    pass
from checkbox_ng.config import CertificationConfig, CheckBoxConfig, CDTSConfig


logger = logging.getLogger("checkbox.ng.main")

checkbox_cli_settings = {
    'subparser_name': 'checkbox-cli',
    'subparser_help': 'application for system testing',
    'default_whitelist': 'default',
    'default_providers': ['2013.com.canonical.certification:checkbox'],
    'welcome_text': """\
Welcome to System Testing!
Checkbox provides tests to confirm that your system is working properly. \
Once you are finished running the tests, you can view a summary report for \
your system.
Warning: Some tests could cause your system to freeze or become \
unresponsive. Please save all your work and close all other running \
applications before beginning the testing process."""
}

cdts_cli_settings = {
    'subparser_name': 'driver-test-suite-cli',
    'subparser_help': 'driver test suite application',
    'default_whitelist': 'ihv-firmware',
    'default_providers': ['2013.com.canonical:canonical-driver-test-suite'],
    'welcome_text': """\
Welcome to the Canonical Driver Test Suite.
This program contains automated and manual tests to help you discover issues \
that will arise when running your device drivers on Ubuntu.
This application will step the user through these tests in a predetermined \
order and automatically collect both system information as well as test \
results. It will also prompt the user for input when manual testing is \
required.
The run time for the tests is determined by which tests you decide to \
execute. The user will have the opportunity to customize the test run to \
accommodate the driver and the amount of time available for testing.
If you have any questions during or after completing your test run, please \
do not hesitate to contact your Canonical account representative.
To begin, simply press the Continue button below and follow the onscreen \
instructions."""
}

cert_cli_settings = {
    'subparser_name': 'certification-server',
    'subparser_help': 'application for server certification',
    'default_whitelist': 'server-selftest-14.04',
    'default_providers': ['2013.com.canonical.certification:certification-server'],
    'welcome_text': """\
Welcome to System Certification!
This application will gather information from your system. Then you will be \
asked manual tests to confirm that the system is working properly. Finally, \
you will be asked for the Secure ID of the computer to submit the \
information to the certification.canonical.com database.
To learn how to create or locate the Secure ID, please see here:
https://certification.canonical.com/"""
}


class CheckBoxNGTool(PlainBoxToolBase):

    @classmethod
    def get_exec_name(cls):
        return "checkbox"

    @classmethod
    def get_exec_version(cls):
        return cls.format_version_tuple(version)

    @classmethod
    def get_config_cls(cls):
        return CheckBoxConfig

    def add_subcommands(self, subparsers):
        SRUCommand(
            self._provider_list, self._config).register_parser(subparsers)
        CheckConfigCommand(
            self._config).register_parser(subparsers)
        ScriptCommand(
            self._provider_list, self._config).register_parser(subparsers)
        DevCommand(
            self._provider_list, self._config).register_parser(subparsers)
        CliCommand(
            self._provider_list, self._config, checkbox_cli_settings
            ).register_parser(subparsers)
        CliCommand(
            self._provider_list, self._config, cdts_cli_settings
            ).register_parser(subparsers)
        CertificationCommand(
            self._provider_list, self._config, cert_cli_settings
            ).register_parser(subparsers)
        try:
            ServiceCommand(self._provider_list, self._config).register_parser(
                subparsers)
        except NameError:
            pass


class CertificationNGTool(CheckBoxNGTool):

    @classmethod
    def get_config_cls(cls):
        return CertificationConfig


class CDTSTool(CheckBoxNGTool):

    @classmethod
    def get_config_cls(cls):
        return CDTSConfig


def main(argv=None):
    """
    checkbox command line utility
    """
    raise SystemExit(CheckBoxNGTool().main(argv))


def checkbox_cli(argv=None):
    """
    CheckBox command line utility
    """
    if argv:
        args = argv
    else:
        args = sys.argv[1:]
    raise SystemExit(
        CheckBoxNGTool().main(['checkbox-cli'] + args))


def cdts_cli(argv=None):
    """
    certification-server command line utility
    """
    if argv:
        args = argv
    else:
        args = sys.argv[1:]
    raise SystemExit(
        CDTSTool().main(['driver-test-suite-cli'] + args))


def cert_server(argv=None):
    """
    certification-server command line utility
    """
    if argv:
        args = argv
    else:
        args = sys.argv[1:]
    raise SystemExit(
        CertificationNGTool().main(['certification-server'] + args))