-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathtest-onboarding.sh
More file actions
executable file
·64 lines (44 loc) · 1.67 KB
/
Copy pathtest-onboarding.sh
File metadata and controls
executable file
·64 lines (44 loc) · 1.67 KB
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
#! /usr/bin/env bash
set -euo pipefail
source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)/utils.sh"
run_test() {
log_info "Setting the error trap handler"
trap on_failure EXIT
log_info "Environment variables"
show_env
log_info "Creating directories"
create_directories
log_info "Build and install 'go-fdo-client' binary"
install_client
log_info "Build and install 'go-fdo-server' binary"
install_server
log_info "Generating service certificates"
generate_service_certs
log_info "Configuring services"
configure_services
log_info "Configure DNS and start services"
start_services
log_info "Wait for the services to be ready:"
wait_for_services_ready
log_info "Setting or updating Rendezvous Info (RendezvousInfo)"
set_or_update_rendezvous_info "${manufacturer_url}" "${rv_info}"
log_info "Adding Device CA certificate to rendezvous"
add_device_ca_cert "${rendezvous_url}" "${device_ca_crt}" | jq -r -M .
log_info "Run Device Initialization"
guid=$(run_device_initialization)
log_info "Device initialized with GUID: ${guid}"
log_info "Setting or updating Owner Redirect Info (RVTO2Addr)"
set_or_update_owner_redirect_info "${owner_url}" "${owner_service_name}" "${owner_dns}" "${owner_port}" "${owner_protocol}"
log_info "Sending Ownership Voucher to the Owner"
send_manufacturer_ov_to_owner "${manufacturer_url}" "${guid}" "${owner_url}"
log_info "Running FIDO Device Onboard"
run_fido_device_onboard ${guid} --debug || log_error "Onboarding failed!"
log_info "Unsetting the error trap handler"
trap - EXIT
test_pass
}
# Allow running directly
[[ "${BASH_SOURCE[0]}" != "$0" ]] || {
run_test
cleanup
}