diff options
author | Scott Moser <smoser@ubuntu.com> | 2017-02-10 22:08:03 -0500 |
---|---|---|
committer | Scott Moser <smoser@brickies.net> | 2017-05-10 10:43:09 -0400 |
commit | 370a04e8d7b530c1ef8280e15eb628ff6880c736 (patch) | |
tree | 4c94b8064391ffde56ea908cd049a9c745440026 /tools/build-on-freebsd | |
parent | 4f0f171c29bb9abb5cbb6f9adbe68015089aeed9 (diff) | |
download | vyos-cloud-init-370a04e8d7b530c1ef8280e15eb628ff6880c736.tar.gz vyos-cloud-init-370a04e8d7b530c1ef8280e15eb628ff6880c736.zip |
Add unit tests for ds-identify, fix Ec2 bug found.
This adds several unit tests for ds-identify, and fixes a bug
in Ec2 detection that I found while writing these tests.
The method of testing is to use the ds-identify code as a shell
library. The TestDsIdentify:call basically does:
* populate a (temp) directory with files that represent what
ds-identify would see in /sys or other locations it reads.
* create a file '_shwrap' that replaces the 3 programs that are executed
in ds-identify code path. It supports setting their stdout, stderr,
and exit code.
* set the default policies explicitly (DI_DEFAULT_POLICY) so we can
support testing different builtins. This is necessary because the
Ubuntu branches patch the builtin value. If we did not explicilty set
it, then testing there would fail.
* execute sh to source the script and call its main.
Diffstat (limited to 'tools/build-on-freebsd')
0 files changed, 0 insertions, 0 deletions