AutoHCK is a tool for automating HCK/HLK testing, doing all the boilerplate steps in the process leaving you with simply choosing which driver you want to test on what os.
There are not so few steps needed to install and set up AutoHCK, First of all clone AutoHCK and follow the instruction below:
Use your package manager to install QEMU or build it from source
Clone VirtHCK, AutoHCK will use it as a dependency.
Get a copy of the powershell script file in rtoolsHCK
Get a clone of rtoolsHCK, execute the follwing to build and install as a gem:
rake build
rake install
Install the following gems using bundler with bundler install
or gem install <gem_name>
:
- dropbox_api
- faraday (version 0.12.2)
- net-ping
- filelock
- octokit
In order to connect to the Studio machine in each HLK/HCK setup, we need to set up a DHCP server that will provide each studio with a predefined unique IP address. The server will assign the IP address according to the machine network adapter mac address with the following rule:
56:00:XX:00:XX:dd > 192.168.0.XX
Use the following script OpenDHCPServerSetup to install and configure OpenDHCPServer.
Filters are fixes for problematic tests, read more at: Microsoft HLK Filters
To run tests with applied filters automatically, get a copy of UpdateFilters.sql
from HCK-CI/hckfilters and place them inside AutoHCK at filters/UpdateFilters.sql
.
To run HLK tests with latest Microsoft compatibility playlist clone HLK Playlists inside AutoHCK and rename the directory to playlists, once it's there AutoHCK will look for the right xml playlist file and apply it to the tests.
To run AutoHCK correctly the runnig user should have permission to run sudo commands without prompting his password, do this by adding the following line to sudoers file /etc/sudoers This might be dangerous to your computer security, do this at your own risk
hck-ci ALL=(ALL) NOPASSWD:ALL
This is similar to making regular HLK/HCK studio and clients images with with few additionals configurations, detailed instrutions available at HLK-Setup-Scripts.
Images will be placeed at the images folder as configured in config.json
file
AutoHCK supports uploading the results of the tests, (logs, test results and the hckx\hlkx package file), using the supported uploaders by configuring the array field "result_uploader" in the config.json
file to the desired uploaders for AutoHCK to use, for example, to use dropbox:
"studio_username": "Administrator",
"studio_password": "Qum5net.",
-> "result_uploaders": [ "dropbox" ]
}
To use dropbox result uploading capabilities you will need to create auth2 token
- go to https://www.dropbox.com/developers/apps and click on 'Create app'
- select 'Dropbox API', 'Full Dropbox' access type and give it a unique name.
- click on 'Generated access token' and use it as environment variable with
export AUTOHCK_DROPBOX_TOKEN=<TOKEN>
When specifing a pull request AutoHCK can mark test results on github and link to dropbox logs folder. to do that you will need to create a personal access token.
- go to https://github.com/settings/tokens and click on 'Generate new token'
- give it a name, select: repo:status and click 'Generate token'
- set new environment variable for your username and token with
export AUTOHCK_GITHUB_LOGIN=<LOGIN>
andexport AUTOHCK_GITHUB_TOKEN=<TOKEN>
There are 3 diffrenet JSON files for configurations, examples included in the files:
config.json
is the general configuration file which holds the paths to the dependencies stated above.platforms.json
list of configured opertaions systems images.devices.json
list of devices drivers information for testing
Once everything is installed and configured, run ./bin/auto_hck
with these parameters:
Required:
-t, --tag [PROJECT]-[OS][ARCH] The driver name and architecture
-p, --path [PATH-TO-DRIVER] The location of the driver
Optional:
-d, --diff <DIFF-LIST-FILE> Path to text file containing a list of changed source files
-c, --commit <COMMIT-HASH> Commit hash for updating github status
-D, --debug Printing debug information
ruby ./bin/auto_hck -t Balloon-Win10x86 -p /home/hck-ci/balloon/win10/x86
ruby ./bin/auto_hck -t NetKVM-Win10x64 -p /home/hck-ci/workspace -d /path/to/diff.txt
ruby ./bin/auto_hck -t viostor-Win10x64 -p /home/hck-ci/viostor -d /path/to/diff.txt -c ec3da560827922e5a82486cf19cd9c27e95455a9
When starting AutoHCK a session workspace will be created inside the workspace directory configured in config.json
at the path: workspace/[device-short]/[platform]/[timestamp]/
Inside AutoHCK will save the following files:
- qcow2 snapshots of the backing setup images:
[filename]-snapshot.qcow2
- AutoHCK log file:
[device-short]-[platform].log
- archived tests log files:
[timestamp]-[testid].zip
- Executables:
st.sh
c1.sh
c2.sh
to rerun test setup machines manually. - HLKX/HCKX file (after tests session ended):
[device-short]-[platform].hlkx
- Lior Haim - Development - Daynix Computing LTD