Project

Profile

Help

Test #5180

closed

Test scenario for filtering fields with created_resources

Added by lmjachky over 4 years ago. Updated over 4 years ago.

Status:
CLOSED - COMPLETE
Priority:
Normal
Assignee:
Sprint/Milestone:
-
Version:
Platform Release:
Tags:
Sprint:
Quarter:

Description

The pull request https://github.com/pulp/pulpcore/pull/228 fixes the issue which prevents users to fetch references to newly created resources while requesting only one field within a filter - created_resources.

A following test scenario may be used for testing:

1. Run the script 2 times in order to create two different tasks in a database:

BASE_ADDR=http://localhost:24817

http POST $BASE_ADDR/pulp/api/v3/remotes/rpm/rpm/ name='epel7-x86_64' url='https://dl.fedoraproject.org/pub/epel/7/x86_64/' policy='immediate'
http POST $BASE_ADDR/pulp/api/v3/repositories/ name='epel7-x86_64'
export REMOTE_HREF=$(http $BASE_ADDR/pulp/api/v3/remotes/rpm/rpm/ | jq -r '.results[] | select(.name == "epel7-x86_64") | ._href')
export REPO_HREF=$(http $BASE_ADDR/pulp/api/v3/repositories/ | jq -r '.results[] | select(.name == "epel7-x86_64") | ._href')
http POST $BASE_ADDR${REMOTE_HREF}sync/ repository=$REPO_HREF

2. Wait until the tasks are successfully completed and a reference to a corresponding created resource is updated:

http http://localhost:24817/pulp/api/v3/tasks/{TASK_ID}/

3. Build a request which will filter out all fields except created_resources:

http http://localhost:24817/pulp/api/v3/tasks/?fields=created_resources

{
    "count": 2,
    "next": null,
    "previous": null,
    "results": [
        {
            "created_resources": [
                "/pulp/api/v3/repositories/e8251e9c-ef26-4dbe-a6fc-2b40c186d464/versions/2/"
            ]
        },
        {
            "created_resources": [
                "/pulp/api/v3/repositories/e8251e9c-ef26-4dbe-a6fc-2b40c186d464/versions/1/"
            ]
        }
    ]
}

4. Check if correct repository versions were returned in the response.


Related issues

Related to Pulp - Issue #4722: Using the "fields=" feature has strange behavior with "created_resources"CLOSED - CURRENTRELEASElmjachkyActions
Actions #1

Updated by lmjachky over 4 years ago

  • Status changed from NEW to POST
  • Assignee set to lmjachky

Added by Lubos Mjachky over 4 years ago

Revision 36f6375d | View on GitHub

Add test for filtering created_resources field

closes #5180 https://pulp.plan.io/issues/5180

Actions #2

Updated by Anonymous over 4 years ago

  • Status changed from POST to MODIFIED
Actions #3

Updated by kersom over 4 years ago

  • Related to Issue #4722: Using the "fields=" feature has strange behavior with "created_resources" added
Actions #4

Updated by kersom over 4 years ago

  • Status changed from MODIFIED to CLOSED - COMPLETE

Also available in: Atom PDF