summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2020-01-28 13:00:09 -0700
committerJens Axboe <axboe@kernel.dk>2020-01-28 13:00:09 -0700
commit39d5034761e25d4d0a57a1563e9b07e027d350a3 (patch)
treeb3b9a273acf16120eedd28cd66dc0cb4d293b816
parent17b83d10e6d393858383bdb1040bbfbb697879ed (diff)
downloadliburing-39d5034761e25d4d0a57a1563e9b07e027d350a3.tar.gz
liburing-39d5034761e25d4d0a57a1563e9b07e027d350a3.tar.bz2
test/personality: test invalid unregister ID
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--test/personality.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/personality.c b/test/personality.c
index 700520e..96c1c66 100644
--- a/test/personality.c
+++ b/test/personality.c
@@ -129,6 +129,20 @@ err:
return 1;
}
+static int test_invalid_unregister(struct io_uring *ring)
+{
+ int ret;
+
+ ret = io_uring_unregister_personality(ring, 2);
+ if (ret != -EINVAL) {
+ fprintf(stderr, "invalid personality unregister got: %d\n", ret);
+ goto err;
+ }
+ return 0;
+err:
+ return 1;
+}
+
int main(int argc, char *argv[])
{
struct io_uring ring;
@@ -160,5 +174,11 @@ int main(int argc, char *argv[])
return ret;
}
+ ret = test_invalid_unregister(&ring);
+ if (ret) {
+ fprintf(stderr, "test_invalid_unregister failed\n");
+ return ret;
+ }
+
return 0;
}