add a test case for UID/GID limits

This commit is contained in:
Nicola Murino 2021-03-25 18:05:18 +01:00
parent 2e6497ea17
commit 30ce6ef736
No known key found for this signature in database
GPG key ID: 2F1FB59433D5A8CB

View file

@ -8,6 +8,7 @@ import (
"fmt"
"io"
"io/ioutil"
"math"
"mime/multipart"
"net"
"net/http"
@ -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 = ""