aboutsummaryrefslogtreecommitdiff
path: root/tests/integration.txt
blob: 938e608e8ace3d64676903dbf49dfe42cba4b96c (plain)
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
A few integration tests we can run while the migration to python is not
complete.  They probably require root or access to specific block devices so
they are not meant to be automated.

    # This should print nothing to stdout but will unpack the given binary
    # tarball under the given directory.
    >>> from linaro_media_create.unpack_binary_tarball import unpack_binary_tarball
    >>> unpack_binary_tarball(<path-to-binary-tarball>, <dir-to-unpack>)

    # Partition (for real!) /dev/sdb for a beagle board and return the devices
    # for the boot and root partitions.
    >>> from linaro_media_create.partitions import Media, setup_partitions
    >>> setup_partitions('beagle', Media('/dev/sdb'), 32, None, 'boot',
    ...     'root', 'ext3', '2e82008e-1af3-4699-8521-3bf5bac1e67a', True,
    ...     True, True)
    Checking that no-one is using this disk right now
    ...
    ('/dev/sdb1', '/dev/sdb2')

    # Partition /tmp/beagle.img for a beagle board and return the loopback
    # devices for the boot and root partitions.
    >>> setup_partitions('beagle', Media('/tmp/beagle.img'), 32, '2G', 'boot',
    ...     'root', 'ext3', '2e82008e-1af3-4699-8521-3bf5bac1e67a', True,
    ...     True, True)
    Warning: /tmp/beagle.img is not a block device
    ...
    ('/dev/loop0', '/dev/loop1')