]> git.proxmox.com Git - mirror_libseccomp.git/commitdiff
tests: test for invalid filter attributes
authorPaul Moore <paul@paul-moore.com>
Wed, 1 Mar 2017 22:34:50 +0000 (17:34 -0500)
committerPaul Moore <paul@paul-moore.com>
Wed, 17 Jan 2018 22:17:40 +0000 (17:17 -0500)
Signed-off-by: Paul Moore <paul@paul-moore.com>
tests/11-basic-basic_errors.c

index f6155840b26313bf08f5726573e0ad9f16813ef9..ddd9e38acbba04a13c0b07948c88af5cb5cded3c 100644 (file)
@@ -28,6 +28,7 @@ int main(int argc, char *argv[])
 {
        int rc;
        scmp_filter_ctx ctx;
+       uint32_t attr;
 
        /* seccomp_init errors */
        ctx = seccomp_init(SCMP_ACT_ALLOW + 1);
@@ -172,5 +173,16 @@ int main(int argc, char *argv[])
        seccomp_release(ctx);
        ctx = NULL;
 
+       /* seccomp_attr_* errors */
+       ctx = seccomp_init(SCMP_ACT_ALLOW);
+       if (ctx == NULL)
+               return -1;
+       rc = seccomp_attr_get(ctx, 1000, &attr);
+       if (rc != -EEXIST)
+               return -1;
+       rc = seccomp_attr_set(ctx, 1000, 1);
+       if (rc != -EEXIST)
+               return -1;
+
        return 0;
 }