OP-TEE / optee_test

Test suite
Other
80 stars 199 forks source link

xtest 6016 why don't fs_open use TEE_DATA_FLAG_OVERWRITE #759

Open XMPengYinjie opened 4 weeks ago

XMPengYinjie commented 4 weeks ago

Hi, why xtest 6016 case don't use TEE_DATA_FLAG_OVERWRITE flag for fs_open after fs_create?

`static void *test_6016_thread(void *arg)
{
    struct test_6016_thread_arg *a = arg;
    TEEC_Session sess = a->session;
    uint32_t obj = 0;
    uint8_t out[10] = { };
    uint32_t count = 0;

    /* create */
    if (!ADBG_EXPECT_TEEC_SUCCESS(a->case_t,
        **fs_create(&sess, a->file_name, sizeof(a->file_name),
              TEE_DATA_FLAG_ACCESS_WRITE, 0, data_01,
              sizeof(data_01), &obj, a->storage_id)))**
        goto exit;

    if (!ADBG_EXPECT_TEEC_SUCCESS(a->case_t, fs_close(&sess, obj)))
        goto exit;

    /* write new data */
    if (!ADBG_EXPECT_TEEC_SUCCESS(a->case_t,
        **fs_open(&sess, a->file_name, sizeof(a->file_name),
            TEE_DATA_FLAG_ACCESS_WRITE, &obj, a->storage_id)))**
        goto exit;
`

fs_open is aim to overwirte the raw data of obj from fs_create, so above fs_open will return TEE_ERROR_ACCESS_CONFLICT.

Now i have a issue in my test, i want to sure if the case codes are wrong.

Could you please help with my question? Thanks!

jenswi-linaro commented 3 weeks ago

TEE_DATA_FLAG_OVERWRITE is not a valid flag for TEE_OpenPersistentObject().