Skip to content

Commit

Permalink
add a test case for UID/GID limits
Browse files Browse the repository at this point in the history
  • Loading branch information
drakkan committed Mar 25, 2021
1 parent 2e6497e commit 30ce6ef
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions httpd/httpd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"fmt"
"io"
"io/ioutil"
"math"
"mime/multipart"
"net"
"net/http"
Expand Down Expand Up @@ -419,6 +420,19 @@ func TestUserStatus(t *testing.T) {
assert.NoError(t, err)
}

func TestUidGidLimits(t *testing.T) {
u := getTestUser()
u.UID = math.MaxInt32
u.GID = math.MaxInt32
user, _, err := httpdtest.AddUser(u, http.StatusCreated)
assert.NoError(t, err)
assert.Equal(t, math.MaxInt32, user.GetUID())
assert.Equal(t, math.MaxInt32, user.GetGID())

_, err = httpdtest.RemoveUser(user, http.StatusOK)
assert.NoError(t, err)
}

func TestAddUserNoCredentials(t *testing.T) {
u := getTestUser()
u.Password = ""
Expand Down

0 comments on commit 30ce6ef

Please sign in to comment.