X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;ds=sidebyside;f=lustre%2Ftests%2Fllapi_layout_test.c;h=a86dc5bf43217722b03c8c33aa28b2600e4c4c3b;hb=6746484df44e456ca3df47708e7d1bc14e4404e8;hp=805d235307b247d23ee96eaebae0c2862d0363d0;hpb=293da2049c902de97c8cad2dfa17486a36473421;p=fs%2Flustre-release.git diff --git a/lustre/tests/llapi_layout_test.c b/lustre/tests/llapi_layout_test.c index 805d235..a86dc5b 100644 --- a/lustre/tests/llapi_layout_test.c +++ b/lustre/tests/llapi_layout_test.c @@ -1483,6 +1483,21 @@ void test31(void) i++; } while (rc == 0); + /* Verify reverse iteration gives the same IDs as forward iteration */ + rc = llapi_layout_comp_use(layout, LLAPI_LAYOUT_COMP_USE_LAST); + ASSERTF(rc == 0, "rc %d, errno %d", rc, errno); + do { + __u32 comp_id; + + --i; + rc = llapi_layout_comp_id_get(layout, &comp_id); + ASSERTF(rc == 0 && comp_id == id[i], + "i %d, errno %d, id[] %u/%u", i, errno, id[i], comp_id); + + rc = llapi_layout_comp_use(layout, LLAPI_LAYOUT_COMP_USE_PREV); + ASSERTF(rc == 0 || i == 0, "i=%d rc=%d errno=%d", i, rc, errno); + } while (rc == 0); + llapi_layout_free(layout); /* delete non-tail component will fail */