@@ -5,6 +5,78 @@ set -euo pipefail
55source " $( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd) /../ci/test-resale.sh"
66source " $( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd) /utils.sh"
77
8+ # Override run_test to inject configure_services before start_services.
9+ # test/ci/test-resale.sh's run_test calls start_services directly (which works
10+ # in the CI context where services are started as plain processes with all
11+ # config passed as CLI flags). In the RPM context, manufacturer/rendezvous/owner
12+ # are systemd services that read config files written by configure_service_*,
13+ # so configure_services must be called first.
14+ # new_owner is still started as a plain nohup process (no RPM systemd unit),
15+ # so it works without configure_service_new_owner.
16+ run_test () {
17+ # Add the new owner service defined above
18+ services+=(" ${new_owner_service_name} " )
19+
20+ log_info " Setting the error trap handler"
21+ trap on_failure ERR
22+
23+ log_info " Environment variables"
24+ show_env
25+
26+ log_info " Creating directories"
27+ create_directories
28+
29+ log_info " Generating service certificates"
30+ generate_service_certs
31+
32+ log_info " Build and install the 'go-fdo-client' binary"
33+ install_client
34+
35+ log_info " Build and install 'go-fdo-server' binary"
36+ install_server
37+
38+ log_info " Configuring services"
39+ configure_services
40+
41+ log_info " Configure DNS and start services"
42+ start_services
43+
44+ log_info " Wait for the services to be ready:"
45+ wait_for_services_ready
46+
47+ log_info " Setting or updating Rendezvous Info (RendezvousInfo)"
48+ set_or_update_rendezvous_info " ${manufacturer_url} " " ${rv_info} "
49+
50+ log_info " Adding Device CA certificate to rendezvous"
51+ add_device_ca_cert " ${rendezvous_url} " " ${device_ca_crt} " | jq -r -M .
52+
53+ log_info " Run Device Initialization"
54+ guid=$( run_device_initialization)
55+ log_info " Device initialized with GUID: ${guid} "
56+
57+ log_info " Sending Ownership Voucher to the Owner"
58+ send_manufacturer_ov_to_owner " ${manufacturer_url} " " ${guid} " " ${owner_url} "
59+
60+ log_info " Extracting the public key from the New Owner cert"
61+ extract_pubkey_from_cert ${new_owner_crt} ${new_owner_pub}
62+
63+ log_info " Trigger the Resell protocol on the current owner"
64+ resell " ${owner_url} " " ${guid} " " ${new_owner_pub} " " ${new_owner_ov} "
65+
66+ log_info " Setting or updating the New Owner Redirect Info (RVTO2Addr)"
67+ set_or_update_owner_redirect_info " ${new_owner_url} " " ${new_owner_service_name} " " ${new_owner_dns} " " ${new_owner_port} " " ${new_owner_protocol} "
68+
69+ log_info " Sending the Ownership Voucher to the New Owner"
70+ send_ov_to_owner " ${new_owner_url} " " ${new_owner_ov} "
71+
72+ log_info " Running FIDO Device Onboard"
73+ run_fido_device_onboard " ${guid} " --debug
74+
75+ log_info " Unsetting the error trap handler"
76+ trap - ERR
77+ test_pass
78+ }
79+
880# Allow running directly
981[[ " ${BASH_SOURCE[0]} " != " $0 " ]] || {
1082 run_test
0 commit comments