test: generate a minimal RPM in pure Go instead of a committed fixture
Removes the committed .rpm binary (gitignored, so it broke clean checkouts) and the rpmbuild dependency. testsupport.MinimalRPM builds a valid-enough RPM header in-memory for cavaliergopher/rpm to parse, used by both the rpm provider test and the full-stack server repodata test.
This commit is contained in:
@@ -301,10 +301,7 @@ func TestServerLocalPyPI(t *testing.T) {
|
||||
|
||||
func TestServerLocalRPMRepodata(t *testing.T) {
|
||||
requireStack(t)
|
||||
rpm, err := os.ReadFile("../provider/rpm/testdata/e2e-testpkg-1.0-1.noarch.rpm")
|
||||
if err != nil {
|
||||
t.Skipf("rpm fixture unavailable: %v", err)
|
||||
}
|
||||
rpm := testsupport.MinimalRPM("e2e-testpkg", "1.0", "1", "noarch")
|
||||
if resp, b := req(t, "POST", "/api/v2/remotes", `{"name":"srv-rpm","package_type":"rpm","repo_type":"local"}`); resp.StatusCode != 201 {
|
||||
t.Fatalf("create rpm local: %d %s", resp.StatusCode, b)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user