- ASSERTF(hca.hca_location.length == 0xffffffffffffffffULL,
- "length=%llu", hca.hca_location.length);
- }
-
- helper_progress = test109_progress;
- helper_archiving(length);
-}
-
-/* Archive, with 10 reports, checking progress. */
-void test110(void)
-{
- const size_t length = 1000;
-
- void test110_progress(struct hsm_copyaction_private *hcp)
- {
- int rc;
- int i;
- struct hsm_extent he;
- struct hsm_current_action hca;
-
- for (i = 0; i < 10; i++) {
- he.offset = i*length/10;
- he.length = length/10;
- rc = llapi_hsm_action_progress(hcp, &he, length, 0);
- ASSERTF(rc == 0, "llapi_hsm_action_progress failed: %s",
- strerror(-rc));
-
- rc = llapi_hsm_current_action(testfile, &hca);
- ASSERTF(rc == 0, "llapi_hsm_current_action failed: %s",
- strerror(-rc));
- ASSERTF(hca.hca_state == HPS_RUNNING,
- "hca_state=%u", hca.hca_state);
- ASSERTF(hca.hca_action == HUA_ARCHIVE,
- "hca_state=%u", hca.hca_action);
- ASSERTF(hca.hca_location.length == (i+1)*length/10,
- "i=%d, length=%llu",
- i, hca.hca_location.length);
- }
- }
-
- helper_progress = test110_progress;
- helper_archiving(length);
-}
-
-/* Archive, with 10 reports in reverse order, checking progress. */
-void test111(void)
-{
- const size_t length = 1000;
-
- void test111_progress(struct hsm_copyaction_private *hcp)
- {
- int rc;
- int i;
- struct hsm_extent he;
- struct hsm_current_action hca;
-
- for (i = 0; i < 10; i++) {
- he.offset = (9-i)*length/10;
- he.length = length/10;
- rc = llapi_hsm_action_progress(hcp, &he, length, 0);
- ASSERTF(rc == 0, "llapi_hsm_action_progress failed: %s",
- strerror(-rc));
-
- rc = llapi_hsm_current_action(testfile, &hca);
- ASSERTF(rc == 0, "llapi_hsm_current_action failed: %s",
- strerror(-rc));
- ASSERTF(hca.hca_state == HPS_RUNNING,
- "hca_state=%u", hca.hca_state);
- ASSERTF(hca.hca_action == HUA_ARCHIVE,
- "hca_state=%u", hca.hca_action);
- ASSERTF(hca.hca_location.length == (i+1)*length/10,
- "i=%d, length=%llu",
- i, hca.hca_location.length);
- }