~canonical-ci-engineering/ubuntu-test-cases/boottest

« back to all changes in this revision

Viewing changes to scripts/boottest.py

  • Committer: Francis Ginther
  • Date: 2015-01-23 23:04:16 UTC
  • Revision ID: francis.ginther@canonical.com-20150123230416-d76qjwtnlw2wyhdo
PACKAGE is now used to specify the input source package to test and gets converted by boottest.py to a list of binaries to install. Install the binaries via an adt-run setup-commands script.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# You should have received a copy of the GNU General Public License along
16
16
# with this program.  If not, see <http://www.gnu.org/licenses/>.
17
17
 
 
18
import argparse
18
19
import os
19
20
import subprocess
20
21
import sys
68
69
    return package_list
69
70
 
70
71
 
71
 
if __name__ == '__main__':
72
 
    source_package = get_input(sys.argv[1])
 
72
def get_installed_binaries(source_package):
 
73
    '''Return the list of binaries installed on the target generated by
 
74
    the given source_package'''
73
75
    all_packages = get_all_package_list()
74
76
    binary_packages = get_binary_package_from_source(source_package)
75
77
    intersection = set(all_packages) & set(binary_packages)
76
78
    print(' '.join(intersection))
77
 
    sys.exit(0)
 
79
    return 0
 
80
 
 
81
 
 
82
def _get_parser():
 
83
    parser = argparse.ArgumentParser(
 
84
        description='Execute a boottest on a touch device.')
 
85
 
 
86
    parser.add_argument('-b', '--binaries',
 
87
                        help='''Return the installed binaries for the given
 
88
                        source package''')
 
89
    return parser
 
90
 
 
91
 
 
92
def main(args):
 
93
    if args.binaries:
 
94
        return get_installed_binaries(args.binaries)
 
95
 
 
96
 
 
97
if __name__ == '__main__':
 
98
    args = _get_parser().parse_args()
 
99
    sys.exit(main(args))