Commit Graph

350 Commits

Author SHA1 Message Date
Ziming Zhang
39fb500318 feat(retention) refactor to use go swagger api
Signed-off-by: Ziming Zhang <zziming@vmware.com>
2021-01-08 07:09:28 +00:00
danfengliu
f57dc13081 Add py-test for system robot account
In this py-test, add a new system robot account, and verify all project privileges.

Signed-off-by: danfengliu <danfengl@vmware.com>
2021-01-08 12:01:53 +08:00
danfengliu
511bd86930
Merge pull request #13849 from danfengliu/add-gui-test-for-system-robot-account
Ad  nightly GUI test for system robot account
2021-01-06 16:59:05 +08:00
Danfeng Liu (c)
ae05e3fdb0 Add Nightly GUI test for system robot account
1. Add GUI test for system robot account feature;
2. Fix issue of failing to catch docker pull image exception in API test.

Signed-off-by: Danfeng Liu (c) <danfengl@vmware.com>
2021-01-06 15:47:04 +08:00
danfengliu
076ebb5ee8 Clear local images in nightly test
Remove local image right after pushing operation, then pull operation can be triggered by docker 20.

Signed-off-by: danfengliu <danfengl@vmware.com>
2021-01-04 10:25:02 +08:00
danfengliu
3659abc62a Migrate gitlab replication test to nightly
Add 2 gitlab pull/push replication test scripts in replication pipeline.

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-12-11 18:04:46 +08:00
danfengliu
ad7581d9b3 Migrate gitlab replication test to nightly
Signed-off-by: danfengliu <danfengl@vmware.com>
2020-12-09 12:00:38 +08:00
danfengliu
56a35437b4
Change image source in e2e pytest (#13640)
Change source of most of test image samples from docker-hub to local building ones, so it will cost less docker-hub pull requests.
And some of cases like push cnab, they have to use docker-hub, but image samples in cnab test will cost 17 quotas, in this PR, we
replace those samples, now cnab case will cost 6 quotas.

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-12-04 02:28:29 -08:00
DQ
590212b485 Remove clair related code
- clair code in harbor core
- clair code in frontend
- clair code in robotcase

Signed-off-by: DQ <dengq@vmware.com>
2020-11-27 14:01:04 +08:00
danfengliu
2bf89e9356 Add docker-hub login before docker-hub pull
Due to docker-hub pull request rate limitation, we will use registed account to pull image
from docker-hub, therefore add docker-hub login in API tests.

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-11-22 21:11:05 +08:00
danfengliu
a70753d382 Add p2p python test script
Signed-off-by: danfengliu <danfengl@vmware.com>
2020-11-11 14:55:23 +08:00
danfengliu
1b127b16c5 Add API test scripts for tag immutability and scan signed image
1. Add 7 API python test scripts for tag immutability;
2. Swagger file has object struct defination issue on imuutability policy rule, because
   this policy is in shared with retention rule, therefore, they should be unified to
   the same  type of rule;
3. Fixed a timeout issue of action keyword, waiting for a long period;
4. Add API test scripts for scan signed image.

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-11-03 10:10:06 +00:00
danfengliu
691168b8cf
Merge pull request #13359 from danfengliu/optimize-upgrade-pipeline-of-pull-push-image
Optimize upgrade pipeline script of push image
2020-10-29 14:31:30 +08:00
danfengliu
ab3e24a2e3 Add proxy cache python test scipts and upgrade containerd
Containerd in e2e image was using native one in ubuntu, it should be updated to the latest release.
And add proxy cache py-tests including pull image/manifest list by docker and ctr CLI.

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-10-28 02:13:40 +00:00
danfengliu
cff4f529cd Optimize upgrade pipeline script of push image
Signed-off-by: danfengliu <danfengl@vmware.com>
2020-10-26 15:16:18 +08:00
danfengliu
4bc7444602 Add UI test for LDAP admin group dn setting
1. Verify LDAP group admin in UI;
2. Update LDAP group admin need to verify the AdminRoleInAuth, get current user will return this field as true.

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-10-14 11:05:09 +08:00
danfengliu
e4894017cd Fix typo in upgrade prepare scritp
Signed-off-by: danfengliu <danfengl@vmware.com>
2020-09-28 10:36:22 +08:00
danfengliu
48510fde08
Merge branch 'master' into add-2.1-upgrade-pipeline-in-nightly 2020-09-22 13:48:22 +08:00
danfengliu
ef53edf553 Recovery nightly setup
1. Recovery nightly setup;
2. Add retry for replication rule selection.
3. Add retry for CNAB test.
4. Rerun keyword of push CNAB

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-09-22 02:41:50 +00:00
danfengliu
e2989e3b93 Add 2.0 & 2.1 upgrade pipeline in nightly
1. Add 2.0 upgrade pipeline in nightly;
2. Add 2.1 upgrade pipeline in nightly.

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-09-22 02:14:40 +00:00
danfengliu
86fb6fdc65 Add checkpoint for LDAP group py-test
LDAP group has different role, user in group has the same role, as groups with different roles were added in project
member list, user should act like in different roles. for admin and dev role, there should be checkpoints to verify priviledges of each own.

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-09-14 21:15:09 +08:00
danfengliu
931bde0df8 Fix issue of missing swagger package for python API test
1. Python API test can't import packages from swagger maker, the reason is that python install packages to site-packages instead of dist-packages,
   so the current solution is to copy pakages from site back to dist, I will try to find a way of using ENV variable to fix this;

2. Remove a python library no longer be used.

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-09-02 15:18:23 +08:00
danfengliu
00180b2a6f Add P2P Preheat UI Test
1. Fix ldap script issue, test case name should be in lowercase;
2. Add manifest list checkout point for proxy cache issue;
3. Add P2P Preheat policy CRUD Test.

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-08-28 11:34:32 +08:00
stonezdj(Daojun Zhang)
b2ed195df5
Merge pull request #12785 from danfengliu/add-distribution-ui-test
Add distribution UI test in nightly
2020-08-21 14:19:05 +08:00
danfengliu
37e280c49f Add proxy-cache and distribution UI test in nightly
1. Add proxy-cache UI test in nightly;
2. Add distribution UI test in nightly.

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-08-21 02:08:06 +00:00
He Weiwei
f659523f50 fix(scan): fix the permission checking for artifact scanning
Closes #12778

Signed-off-by: He Weiwei <hweiwei@vmware.com>
2020-08-17 09:55:38 +00:00
danfengliu
e1eac2b4d0
Merge pull request #12688 from danfengliu/fix-upgrade-test-wrong-keyword-issue
Fix wrong keyword issue in upgrade test
2020-08-14 10:11:37 +08:00
danfengliu
9a2188641d Upgrade python and robot for drone build
1.Separate Dockerfile to drone and nightly e2e, one Dockerfile should cover
 both scenarios, it will be resolved later;
2.Fix docker api err type issue, API error has no message attibute;
3.Upgrade docker in nightly e2e images.

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-08-12 10:26:12 +00:00
danfengliu
ab7767f539 Fix wrong keyword issue in upgrade test
Signed-off-by: danfengliu <danfengl@vmware.com>
2020-08-10 14:47:38 +00:00
danfengliu
4968b6619b Recovery drone build script
Signed-off-by: danfengliu <danfengl@vmware.com>
2020-08-10 14:23:44 +00:00
Flávio Ramalho
3d3fabbd20
Make notary-remove-image-signature more flexible (#12536)
Instead of explicitly defining the expect path to /usr/local/bin/expect,
use the env command, so the expect executable is searched for and launched
from wherever it is first found.

Signed-off-by: Flávio Ramalho <framalho@suse.com>
2020-07-31 15:49:45 +08:00
danfengliu
8328e95b63 Add GCS&S3 push-based replicatiton tests
1. Add GCS push-based replicatiton tests;
   There is an issue against it, so it's commented out;
2. Add S3 push-based replicatiton tests;
3. Add filter registry keyword;

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-07-29 12:44:49 +00:00
danfengliu
8a691c5df1 Add OIDC user onboard test in nightly
Signed-off-by: danfengliu <danfengl@vmware.com>
2020-07-27 13:56:18 +08:00
danfengliu
e20cb51d6b Fix issues in replication tests
Signed-off-by: danfengliu <danfengl@vmware.com>
2020-07-20 09:42:55 +08:00
danfengliu
aa43afb601 Add push-based replication test in nightly
Signed-off-by: danfengliu <danfengl@vmware.com>
2020-07-16 19:50:42 +08:00
danfengliu
0cb378d8fa Verify error message when deleting signed image
1. Verify error message when deleting signed image;
2. Add test case - Replication From Dockerhub;

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-07-06 10:56:31 +08:00
AllForNothing
fff6f7529a Replace all whitelist with allowlist
Signed-off-by: AllForNothing <sshijun@vmware.com>
2020-06-24 16:17:17 +08:00
danfengliu
a8f159728b Add API E2E pytest of GC with untag flag enabled
1. Fix issue of keyword Go Into Repo, the verification logic could be more strict;
2. Add API E2E pytest of GC with untag flag enabled;
3. Add sleep in test_user_view_logs.py for delete log ocurred;
4. Test Case - Tag CRUD is not stable. Although add button was clicked, but the tag was'nt added successfully.

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-06-23 14:48:04 +08:00
danfengliu
67ccc98c58 Add helm and helm3 CLI py-test
Signed-off-by: danfengliu <danfengl@vmware.com>
2020-06-16 16:27:31 +08:00
danfengliu
4b5080d44e Add singularity py-test
Signed-off-by: danfengliu <danfengl@vmware.com>
2020-06-10 11:09:41 +08:00
danfengliu
e020b90bf0 add oras cli py-test
1. Add oras cli py-test;
2. Add env for notary url, allow to input different notary port instead of solid 4443;
3. Add retry for keyword Cannot Pull Image and make it longer during retry.

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-06-08 11:10:07 +08:00
danfengliu
3f2850ffdf Scan result behavior changed after trivy upgrade
Signed-off-by: danfengliu <danfengl@vmware.com>
2020-06-04 16:25:21 +08:00
danfengliu
ceaa0a57b3 Add replication schedule test
1. Add replication schedule test;
2. Add some sleep after project creation before push image to avoid push image v2 error.
   It fixed issue# 12094: Scan image vmware/photon:1.0 return unsupported occasionally.
3. Add some sleep in test_user_view_logs.py, can't get operation logs sometimes.

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-06-02 15:51:10 +08:00
danfengliu
5d8a308158 Add retry for keyword go into index
1. Add retry for keyword go into index;
2. Add retry for keyword go into project.
Signed-off-by: danfengliu <danfengl@vmware.com>
2020-05-27 08:55:58 +00:00
danfengliu
a07cc7bb2a
Merge pull request #11967 from danfengliu/fix-nightly-log-verification
Modify nightly quotas error message verification
2020-05-20 14:38:37 +08:00
danfengliu
b4a54adfeb Add Scan schedule test in nightly
1. Add Scan schedule test in nightly;
2. Remove redundancy steps when create a new project;

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-05-20 12:16:33 +08:00
danfengliu
2fb90cf258 Modify nightly quotas error message verification
Signed-off-by: danfengliu <danfengl@vmware.com>
2020-05-19 14:59:21 +08:00
danfengliu
ac19f02bf5 Enhance verificaton for tag retention pytest
1. Modify scan related keywords, some of keywords are not effective.

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-05-12 16:41:47 +08:00
danfengliu
d10dfc8167 Fix issue of GC untag images case
Signed-off-by: danfengliu <danfengl@vmware.com>
2020-04-30 16:10:03 +08:00
danfengliu
768b292b15 Add double confirm for clicking untag checkbox
1. Add double confirm for clicking untag checkbox;
2. Add retry for waiting GC completion;

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-04-29 20:21:07 +08:00
danfengliu
cd0463047b Add tag for ui test case of add nuew user
Signed-off-by: danfengliu <danfengl@vmware.com>
2020-04-28 19:47:47 +08:00
danfengliu
f8ce615e12 Add ctr command for pulling oci
1. Manifest list can be pulled by ctr;
2. ui-test missing key checkpoint, fix it by add checking scan detail result;
3. add tag retension untag image test;

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-04-28 15:01:49 +08:00
AllForNothing
8ff4003438 Add new nightly case admin add new users
Signed-off-by: AllForNothing <sshijun@vmware.com>
2020-04-28 11:10:06 +08:00
danfengliu
fdded0744a Clean up gitaction env and add tag for pytest
1. Add docker prune cmd to release some space;
2. Add tag for pytest in case of debugging requirement;
3. Replace image to smaller size in robot account pytest;

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-04-20 18:19:28 +08:00
Danfeng Liu (c)
1cc5d0261b Add robot-account verification for upgrade test
1. Add Clair should be default scanner in upgrade test;
2. Add tag retention verification in upgrade test;
3. Add tag retention verification in upgrade test;
4. Add tag Immutability verification in upgrade test;
5. Add webhook verification in upgrade test;
6. Add CVE whitelist in upgrade test;

Signed-off-by: Danfeng Liu (c) <danfengl@vmware.com>
2020-04-16 22:16:33 +08:00
Yogi_Wang
589d05a894 nightly move switch scanner case to mutiple-scanner file
Signed-off-by: Yogi_Wang <yawang@vmware.com>
2020-04-16 10:05:08 +08:00
Yogi_Wang
8835813439 [test-case] add switch scanner case
Signed-off-by: Yogi_Wang <yawang@vmware.com>
2020-04-15 14:53:17 +08:00
AllForNothing
46320641b4 Add new nightly case for GC untagged images
Signed-off-by: AllForNothing <sshijun@vmware.com>
2020-04-14 09:25:06 +08:00
Will Sun
009662a317
Merge pull request #11426 from AllForNothing/nightly-tag
Add new nightly cases for tag CRUD
2020-04-13 12:15:18 +08:00
danfengliu
a869bba59f Modify quota error info due to product changed
Signed-off-by: danfengliu <danfengl@vmware.com>
2020-04-10 21:06:05 +08:00
danfengliu
66dfd59c80 Add Multi-Scanner test file
1. Add Multi-Scanner test file for harbor is deployed with multi scanners;
2. Modify notary doc description;
3. Add paragraph for e2e-api-python-based-scripting-guide;
4. Fix delete project issue;
5. Remove count qoutas in nightly and modify some of it;
6. Add Trivy in git hub offline action;

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-04-08 16:26:31 +08:00
AllForNothing
e342b4ef0b Add new nightly cases for tag CRUD
Signed-off-by: AllForNothing <sshijun@vmware.com>
2020-04-08 09:56:27 +08:00
Yogi_Wang
2610fe530f [Test Case] Add nightly case for CVE
1. add nightly case for cve
2. change translate words
Signed-off-by: Yogi_Wang <yawang@vmware.com>
2020-04-03 16:59:45 +08:00
jwangyangls
4ea7b13215
Merge pull request #11385 from jwangyangls/nightly-case-trivy-2
[Nightly] Project Level Image Serverity Policy
2020-04-02 11:14:21 +08:00
danfengliu
aa26e624b9
Merge pull request #11379 from danfengliu/add-nightly-test-of-push-helm-chart
Add nightly test of push helm chart
2020-04-02 10:29:21 +08:00
Yogi_Wang
01f8291bb7 [Nightly] Project Level Image Serverity Policy
Signed-off-by: Yogi_Wang <yawang@vmware.com>
2020-04-02 10:16:57 +08:00
danfengliu
e3b31bb8dd Add nightly test of push helm chart
1. Add push helm chart oci test in nightly;
2. Modify archive icon locator xpath;

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-04-01 18:53:19 -07:00
danfengliu
f11e713ada
Merge pull request #11380 from jwangyangls/nightly-case-trivy-1
[Nightly] add case about trivy
2020-04-01 22:45:40 +08:00
Yogi_Wang
24b57715ab [Night] add case about trivy
`
Signed-off-by: Yogi_Wang <yawang@vmware.com>
2020-04-01 17:06:34 +08:00
AllForNothing
e6e3f0a6af Fix nightly cases for webhook
Signed-off-by: AllForNothing <sshijun@vmware.com>
2020-04-01 16:27:40 +08:00
danfengliu
8f9822d168 Add nightly test case of push docker manifest list
1. Add notary tool in E2E Dockerfile;
2. Add push docker manifest list test in nightly;
3. Modify document for e2e user guide;
4. Add CNAB tool  in E2E Dockerfile;

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-04-01 06:51:13 +00:00
danfengliu
77e3b0d828 Fix nightly ldap test cases
1. Modify robot account test, checkout "Never Expired" button;
2. Modify OIDC get user API;
3. Modify verification for docker pull command;

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-03-27 20:24:43 +08:00
Yogi_Wang
1f3e00c782 [Nightly] Add case for trivy
Signed-off-by: Yogi_Wang <yawang@vmware.com>
2020-03-27 15:20:39 +08:00
danfengliu
08a070a124 Modify nightly test case for user view logs and other
Signed-off-by: danfengliu <danfengl@vmware.com>
2020-03-23 14:19:13 +08:00
danfengliu
deb225b0f2 Modify elements locator in nightly tests
1. Modify get signature API in sign image test;
2. Modify locator for tag in artifact list;

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-03-22 20:48:37 +08:00
danfengliu
35786e8efd Analyze nightly failed cases
1. Modify delete repo button locator;
2. Modify verifcation for GC log result message;
3. Modify locator for tag retention.
4. Add empty Trivy pipeline.

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-03-21 11:30:15 +08:00
Yogi_Wang
13ae4482ab [OCI] Change nightly case and change delete artifact words
1.nightly: fix tag retention and immutable tag case xpath
2.nightly: fix the part of delete repo button xpath
3.nightly: fix the api version when GC
4.nightly: fix add label of artifact xpath
5.text:   change delete artifact show words
Signed-off-by: Yogi_Wang <yawang@vmware.com>
2020-03-20 15:59:16 +08:00
Wang Yan
dc6eec8a73
Enable API logs test case (#11142)
1, enable user view log api test case
2, update project logs api permission check
3, use project ctl instead in permission check base method

Signed-off-by: wang yan <wangyan@vmware.com>
2020-03-19 14:56:37 +08:00
danfengliu
77e9fc38c7 Modify api test for test step of add addition
Signed-off-by: danfengliu <danfengl@vmware.com>
2020-03-18 17:32:10 +08:00
Wenkai Yin(尹文开)
b0e87b46e4
Merge pull request #11003 from danfengliu/modify_api_test_scan_image_2
Modify API test for scan image since harbor v2 API presented
2020-03-18 11:00:55 +08:00
danfengliu
995ce30c58 Modify API test for scan image since harbor v2 API presented
1. System level Scan All;
2. Scan An Image Artifact

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-03-18 10:15:07 +08:00
Wenkai Yin
3aca33acde Clean up some TODO items
1. Remove blob fetcher and cache

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2020-03-17 19:01:38 +08:00
Wenkai Yin
e33b2984ce Add create/delete tag API test case
Add create/delete tag API test case

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2020-03-16 21:32:34 +08:00
danfengliu
843b05c2d3 Add script of push cnab bunlde API test
Signed-off-by: danfengliu <danfengl@vmware.com>
2020-03-16 17:37:16 +08:00
danfengliu
42956c74bb
Merge pull request #11018 from danfengliu/add-verification-for-helm-api-test
Add verfication for helm API test
2020-03-16 10:17:37 +08:00
He Weiwei
28dcb5ad59
test(quota): enable quota test case in API robot (#11039)
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2020-03-12 11:50:30 +08:00
danfengliu
f8811102da Add verfication for helm API test
Signed-off-by: danfengliu <danfengl@vmware.com>
2020-03-11 15:05:16 +08:00
Wang Yan
f49994d81d
enable garbage colloection api test case (#11000)
Signed-off-by: wang yan <wangyan@vmware.com>
2020-03-11 11:19:29 +08:00
danfengliu
e49ac2f9e9 Add API test python script - Push chart file by Helm3 chart command line
Signed-off-by: danfengliu <danfengl@vmware.com>
2020-03-05 14:58:36 +08:00
danfengliu
2d6e18a895 Add API test case of pushing index by docker manifest
Signed-off-by: danfengliu <danfengl@vmware.com>
2020-03-02 06:31:59 +00:00
danfengliu
c283a02e5f Update existing API tests for API V2.0
Signed-off-by: danfengliu <danfengl@vmware.com>
2020-02-26 21:38:39 +08:00
danfengliu
4933bb634f Upgrade repository API tests to V2.0
Enable _xsrf in cookies in swagger.yaml, so that scripts don't have to handle it.

Signed-off-by: danfengliu <danfengl@vmware.com>
2020-02-24 18:15:25 +08:00
Wenkai Yin
bd204464f3 Remove dead code
Remove dead code

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2020-02-23 17:11:46 +08:00
Wenkai Yin
94787ea60d Bump up the version of legacy APIs to v2.0
Bump up the version of legacy APIs to v2.0

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2020-02-14 13:16:30 +08:00
Wenkai Yin
a4ebbc6ecf Do enhancement for the registry authorizer
This commit introduces a new wrapper authorizer which can authorize the request according to the auth scheme automatically

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2020-02-11 21:21:49 +08:00
Wenkai Yin
ef3af85a5b Register registry handler with the new methods of Route
Register registry handler with the new methods of Route

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2020-02-03 16:55:08 +08:00
Daniel Jiang
2064a1cd6d Switch to basic authentication for registry
1. Add basic authorizer for registry which modify the request
to add basic authorization header to request based on configuration.
2. Set basic auth header for proxy when accessing registry
3. Switche the registry to use basic auth by default and use the basic
authorizer to access Harbor.
4. Make necessary change to test cases, particularly
"test_robot_account.py" and "docker_api.py", because the error is
changed after siwtched to basic auth from token auth.  #10604 is opened
to track the follow up work.

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2020-01-31 21:46:47 +09:00
Wenkai Yin(尹文开)
a1b25e1fec
Switch to new registry API handlers (#10596)
Switch to new registry API handlers

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2020-01-30 21:21:07 +08:00
Danfeng Liu (c)
d9c0a4ae67 Switch registry from docker-hub ot internal harbor registry
Signed-off-by: Danfeng Liu (c) <danfengl@vmware.com>
:q
2020-01-17 10:43:20 +08:00
Danfeng Liu (c)
d02f15fb0f Add retry for prject list display
Signed-off-by: Danfeng Liu (c) <danfengl@vmware.com>
2020-01-13 15:44:31 +08:00