fix arch pkg

This commit is contained in:
dragon 2024-10-21 10:08:57 +08:00
parent 55c30ba266
commit 95c7599db5
3 changed files with 41 additions and 4 deletions

View file

@ -336,6 +336,30 @@ HMhNSS1IzUsBcpJAPFAwwUXSM0u4BjoaR8EoGAWjgGQAAILFeyQADAAA
MakeRequest(t, req, http.StatusNoContent)
}
})
t.Run("Package Arch Test", func(t *testing.T) {
defer tests.PrintCurrentTest(t)()
req := NewRequestWithBody(t, "PUT", rootURL, bytes.NewReader(pkgs["any"])).
AddBasicAuth(user.Name)
MakeRequest(t, req, http.StatusCreated)
req = NewRequest(t, "GET", rootURL+"/x86_64/base.db")
respPkg := MakeRequest(t, req, http.StatusOK)
files, err := listTarGzFiles(respPkg.Body.Bytes())
require.NoError(t, err)
require.Len(t, files, 1)
req = NewRequestWithBody(t, "PUT", rootURL, bytes.NewReader(pkgs["otherXZ"])).
AddBasicAuth(user.Name)
MakeRequest(t, req, http.StatusCreated)
req = NewRequest(t, "GET", rootURL+"/x86_64/base.db")
respPkg = MakeRequest(t, req, http.StatusOK)
files, err = listTarGzFiles(respPkg.Body.Bytes())
require.NoError(t, err)
require.Len(t, files, 2)
})
}
func getProperty(data, key string) string {