Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ofaurax committed Oct 26, 2023
1 parent da34134 commit 844e950
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions providers/asrockrack/mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func mockASRockBMC() *httptest.Server {
// fw update endpoints - in order of invocation
handler.HandleFunc("/api/maintenance/flash", bmcFirmwareUpgrade)
handler.HandleFunc("/api/maintenance/firmware", bmcFirmwareUpgrade)
handler.HandleFunc("/api/maintenance/firmware/firmware", bmcFirmwareUpgrade)
handler.HandleFunc("/api/maintenance/firmware/verification", bmcFirmwareUpgrade)
handler.HandleFunc("/api/maintenance/firmware/upgrade", bmcFirmwareUpgrade)
handler.HandleFunc("/api/maintenance/firmware/flash-progress", bmcFirmwareUpgrade)
Expand Down Expand Up @@ -212,6 +213,9 @@ func bmcFirmwareUpgrade(w http.ResponseWriter, r *http.Request) {

// 2. upload firmware
case "/api/maintenance/firmware":
// make it fail to test the other URL
w.WriteHeader(http.StatusBadRequest)
case "/api/maintenance/firmware/firmware":

// validate flash mode set
if !fwUpgradeState.FlashModeSet {
Expand Down

0 comments on commit 844e950

Please sign in to comment.