From 86e536203ba5f0dfbd29a9e596b78a91780ba363 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Fri, 2 Sep 2022 13:35:16 +0800 Subject: [PATCH] * Modify server url. --- test/model/gitlab/apigetcurrentuser.php | 6 +++--- test/model/gitlab/checktokenaccess.php | 4 ++-- test/model/gitlab/create.php | 8 ++++---- test/model/gitlab/update.php | 4 ++-- test/model/jenkins/create.php | 12 ++++-------- test/model/jenkins/update.php | 6 +++--- 6 files changed, 18 insertions(+), 22 deletions(-) diff --git a/test/model/gitlab/apigetcurrentuser.php b/test/model/gitlab/apigetcurrentuser.php index acf6f247ad..e4c465f3a3 100755 --- a/test/model/gitlab/apigetcurrentuser.php +++ b/test/model/gitlab/apigetcurrentuser.php @@ -30,14 +30,14 @@ $result = $gitlab->apiGetCurrentUser($host, $token); if(!$result) $result = 'return null'; r($result) && p() && e('return null'); //使用错误的host获取用户信息 -$host = 'http://10.0.1.161:51080'; +$host = 'http://10.0.7.242:9980'; $result = $gitlab->apiGetCurrentUser($host, $token); r($gitlab->apiGetCurrentUser($host, $token)) && p('message') && e('401 Unauthorized'); //使用正确的host,错误的token获取用户信息 -$token = 'x88fZokrp5hShia2jyBN'; +$token = 'y2UBqwPPzaLxsniy8R6A'; $result = $gitlab->apiGetCurrentUser($host, $token); r($result) && p('id') && e('1'); //通过host,token获取用户信息 $token = 'wVFHE6NZA-cJy-3U2y2J'; $result = $gitlab->apiGetCurrentUser($host, $token); -r($result) && p('error') && e('insufficient_scope'); //通过host,权限不足的token获取用户信息 \ No newline at end of file +r($result) && p('error') && e('insufficient_scope'); //通过host,权限不足的token获取用户信息 diff --git a/test/model/gitlab/checktokenaccess.php b/test/model/gitlab/checktokenaccess.php index 2382aa49c4..641d8db5a2 100755 --- a/test/model/gitlab/checktokenaccess.php +++ b/test/model/gitlab/checktokenaccess.php @@ -30,7 +30,7 @@ $result = $gitlab->checkTokenAccess($host, $token); if(!$result) $result = 'return false'; r($result) && p() && e('return false'); //使用错误的host验证token权限 -$host = 'http://10.0.1.161:51080'; +$host = 'http://10.0.7.242:9980'; $result = $gitlab->checkTokenAccess($host, $token); if(empty($result)) $result = 'return null'; r($result) && p() && e('return null'); //使用正确的host,错误的token验证token权限 @@ -43,4 +43,4 @@ r($result) && p() && e('success'); //通过host,token验证token权限 $token = 'wVFHE6NZA-cJy-3U2y2J'; $result = $gitlab->checkTokenAccess($host, $token); if(!isset($result->id)) $result = 'no access'; -r($result) && p() && e('no access'); //通过host,权限不足的token验证token权限 \ No newline at end of file +r($result) && p() && e('no access'); //通过host,权限不足的token验证token权限 diff --git a/test/model/gitlab/create.php b/test/model/gitlab/create.php index 98b43ccdfb..f698367593 100644 --- a/test/model/gitlab/create.php +++ b/test/model/gitlab/create.php @@ -12,7 +12,7 @@ pid=1 GitLab名称为空 >> name 服务器地址为空 >> url -正确GitLab数据 >> GitLab,http://10.0.1.161:58080,1196c85ba525a268570df9da627e3a7b2d +正确GitLab数据 >> GitLab,http://10.0.7.242:9980,1196c85ba525a268570df9da627e3a7b2d */ @@ -20,7 +20,7 @@ $gitlab = new gitlabTest(); $_POST = array(); $_POST['name'] = ''; -$_POST['url'] = 'http://10.0.1.161:51080'; +$_POST['url'] = 'http://10.0.7.242:9980'; $_POST['token'] = 'y2UBqwPPzaLxsniy8R6A'; $_POST['password'] = ''; @@ -30,7 +30,7 @@ $_POST['name'] = 'GitLab'; $_POST['url'] = ''; r($gitlab->create()) && p() && e('url'); // 服务器地址为空 -$_POST['url'] = 'http://10.0.1.161:51080'; -r($gitlab->create()) && p('name,url,token') && e('GitLab,http://10.0.1.161:51080,y2UBqwPPzaLxsniy8R6A'); // 正确GitLab数据 +$_POST['url'] = 'http://10.0.7.242:9980'; +r($gitlab->create()) && p('name,url,token') && e('GitLab,http://10.0.7.242:9980,y2UBqwPPzaLxsniy8R6A'); // 正确GitLab数据 system("./ztest init"); diff --git a/test/model/gitlab/update.php b/test/model/gitlab/update.php index 4006e3466d..7d3517c934 100644 --- a/test/model/gitlab/update.php +++ b/test/model/gitlab/update.php @@ -22,7 +22,7 @@ $gitlabID = 3; $_POST = array(); $_POST['name'] = ''; -$_POST['url'] = 'http://10.0.1.161:51080'; +$_POST['url'] = 'http://10.0.7.242:9980'; $_POST['account'] = 'admin'; $_POST['token'] = 'y2UBqwPPzaLxsniy8R6A'; $_POST['password'] = ''; @@ -33,7 +33,7 @@ $_POST['name'] = 'Changed GitLab'; $_POST['url'] = ''; r($gitlab->update($gitlabID)) && p() && e('url'); // 服务器地址为空 -$_POST['url'] = 'http://10.0.1.161:51080'; +$_POST['url'] = 'http://10.0.7.242:9980'; r($gitlab->update($gitlabID)) && p('name') && e('Changed GitLab'); // 正确GitLab数据 system("./ztest init"); diff --git a/test/model/jenkins/create.php b/test/model/jenkins/create.php index cebc2d7076..853895bfe7 100755 --- a/test/model/jenkins/create.php +++ b/test/model/jenkins/create.php @@ -11,17 +11,13 @@ title=测试jenkinsModel->create(); cid=1 pid=1 -Jenkins名称为空 >> name -服务器地址为空 >> url -正确Jenkins数据 >> Jenkins,http://10.0.1.161:58080,1196c85ba525a268570df9da627e3a7b2d - */ $jenkins = new jenkinsTest(); $_POST = array(); $_POST['name'] = ''; -$_POST['url'] = 'http://10.0.1.161:58080'; +$_POST['url'] = 'http://10.0.7.242:9580'; $_POST['account'] = 'admin'; $_POST['token'] = '1196c85ba525a268570df9da627e3a7b2d'; $_POST['password'] = ''; @@ -32,7 +28,7 @@ $_POST['name'] = 'Jenkins'; $_POST['url'] = ''; r($jenkins->create()) && p() && e('url'); // 服务器地址为空 -$_POST['url'] = 'http://10.0.1.161:58080'; -r($jenkins->create()) && p('name,url,token') && e('Jenkins,http://10.0.1.161:58080,1196c85ba525a268570df9da627e3a7b2d'); // 正确Jenkins数据 +$_POST['url'] = 'http://10.0.7.242:9580'; +r($jenkins->create()) && p('name,url,token') && e('Jenkins,http://10.0.7.242:9580,1196c85ba525a268570df9da627e3a7b2d'); // 正确Jenkins数据 -$db->restoreDB(); \ No newline at end of file +$db->restoreDB(); diff --git a/test/model/jenkins/update.php b/test/model/jenkins/update.php index f8d0445b29..a51185f738 100755 --- a/test/model/jenkins/update.php +++ b/test/model/jenkins/update.php @@ -23,7 +23,7 @@ $jenkinsID = 3; $_POST = array(); $_POST['name'] = ''; -$_POST['url'] = 'http://10.0.1.161:58080'; +$_POST['url'] = 'http://10.0.7.242:9580'; $_POST['account'] = 'admin'; $_POST['token'] = '1196c85ba525a268570df9da627e3a7b2d'; $_POST['password'] = ''; @@ -34,7 +34,7 @@ $_POST['name'] = 'Changed Jenkins'; $_POST['url'] = ''; r($jenkins->update($jenkinsID)) && p() && e('url'); // 服务器地址为空 -$_POST['url'] = 'http://10.0.1.161:58080'; +$_POST['url'] = 'http://10.0.7.242:9580'; r($jenkins->update($jenkinsID)) && p('name') && e('Changed Jenkins'); // 正确Jenkins数据 -$db->restoreDB(); \ No newline at end of file +$db->restoreDB();