Re: [PATCH v1 1/2] selinux-testsuite: Infiniband pkey tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 25, 2017 at 3:56 PM, Stephen Smalley <sds@xxxxxxxxxxxxx> wrote:
> On Wed, 2017-05-24 at 17:18 +0300, Dan Jurgens wrote:
>> From: Daniel Jurgens <danielj@xxxxxxxxxxxx>
>>
>> New tests for infiniband pkeys. Most users don't have Infiniband
>> hardware, and if they do the pkey configuration is not standardized.
>> There is a configuration file for enabling the test and setting
>> environment specific test configurations. If the tests are disabled
>> they
>> will always show as passed.
>>
>> Signed-off-by: Daniel Jurgens <danielj@xxxxxxxxxxxx>

...

>> diff --git a/tests/infiniband_pkey/create_modify_qp.c
>> b/tests/infiniband_pkey/create_modify_qp.c
>> new file mode 100644
>> index 0000000..495ef5b
>> --- /dev/null
>> +++ b/tests/infiniband_pkey/create_modify_qp.c
>> @@ -0,0 +1,144 @@
>> +#include <stdio.h>
>> +#include <stdlib.h>
>> +#include <string.h>
>> +#include <errno.h>
>> +#include <assert.h>
>> +#include <unistd.h>
>> +#include <sys/socket.h>
>> +#include <netinet/in.h>
>> +#include <arpa/inet.h>
>> +#include <infiniband/verbs.h>
>> +
>> +struct ibv_qp           *qp;
>> +struct ibv_context *context;
>> +struct ibv_pd      *pd;
>> +struct ibv_cq      *cq;
>> +struct ibv_srq     *srq;
>> +
>> +void cleanup_ib_rsrc()
>> +{
>> +     ibv_destroy_qp(qp);
>> +     ibv_destroy_srq(srq);
>> +     ibv_destroy_cq(cq);
>> +     ibv_dealloc_pd(pd);
>> +     ibv_close_device(context);
>> +}
>> +
>> +int init_ib_rsrc(char* deviceName)
>> +{
>> +     int                 ndev = 0;
>> +     struct ibv_device  **dlist = ibv_get_device_list(&ndev);
>> +     struct ibv_device  *device = NULL;;
>> +     struct ibv_srq_init_attr srqiattr;
>> +     struct ibv_qp_init_attr qpiattr;
>> +     int i;
>> +
>> +     if (!ndev)
>> +     {
>
> Can you run these test programs through
> astyle --options=none --lineend=linux --mode=c --style=linux --
> indent=force-tab=8 --indent-preprocessor --indent-col1-comments --min-
> conditional-indent=0 --max-instatement-indent=80 --pad-oper --align-
> pointer=name --align-reference=name --max-code-length=80 --break-after-
> logical

FYI, the tools/check-syntax should be able to fixup the sources for you.

-- 
paul moore
www.paul-moore.com



[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux