From 6fa7223e4b77306444c0ba7c1b56ede115721bce Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Tue, 25 Jun 2019 09:16:22 +0800 Subject: [PATCH] git password --- app/controllers/gits_controller.rb | 1 + lib/gitcheck/myshixun_update.txt | 0 lib/gitcheck/readme_test.txt | 51 ++++++++++++++++++++++++++++++ lib/gitcheck/shixun_update.txt | 0 lib/tasks/git_check.rake | 16 ++++++++++ 5 files changed, 68 insertions(+) create mode 100644 lib/gitcheck/myshixun_update.txt create mode 100644 lib/gitcheck/readme_test.txt create mode 100644 lib/gitcheck/shixun_update.txt create mode 100644 lib/tasks/git_check.rake diff --git a/app/controllers/gits_controller.rb b/app/controllers/gits_controller.rb index 60a551e7b..d1e3912b6 100644 --- a/app/controllers/gits_controller.rb +++ b/app/controllers/gits_controller.rb @@ -17,6 +17,7 @@ class GitsController < ApplicationController input_username = username_password.split(":")[0].strip() input_password = username_password.split(":")[1].strip() uid_logger("git start auth: input_username is #{input_username}") + uid_logger("git start auth: password is #{input_password}") # Git 超级权限用户 if input_username.strip == gituser.strip && input_password.strip == gitpassword.strip diff --git a/lib/gitcheck/myshixun_update.txt b/lib/gitcheck/myshixun_update.txt new file mode 100644 index 000000000..e69de29bb diff --git a/lib/gitcheck/readme_test.txt b/lib/gitcheck/readme_test.txt new file mode 100644 index 000000000..03f757f18 --- /dev/null +++ b/lib/gitcheck/readme_test.txt @@ -0,0 +1,51 @@ +# 新版Git测试说明 +统一: +参考实训:http://47.96.87.25:48080/shixuns/ca9fvobr/repository +请求方式:POST +参数{repo_path: "educoder/ca9fvobr.git"} +公共方法: +['add_repository', 'fork_repository', 'delete_repository', 'file_tree', 'update_file', + 'file_content', 'commits'] + +1、仓库目录接口 + 测试方法:模拟1000个用户同时去访问接口,访问方式 + http://121.199.19.206:9000/api/file_tree + 参数: + {repo_path: "educoder/ca9fvobr.git", path: ''} // 如:{path: 'step1'} + +2、创建版本库 + 访问地址:http://121.199.19.206:9000/api/add_repository + 参数: + {repo_path: 比如:"Hjqreturn/aaass1.git"} + +3、fork版本库 + http://121.199.19.206:9000/api/fork_repository + 参数: + {repo_path: 'Hjqreturn/aaass1.git', fork_repository_path: 'educoder/ca9fvobr.git'} + 说明:fork_repository_path是源项目的repo_path, repo_path是新项目的 + + +4、更新文件 + 测试方法: + 1、更新同一个文件,并发量可以不用很大,可以用同一个用户并发10-100 + 2、更新不同的文件:可以依据创建的版本库去更新 + 访问地址:http://121.199.19.206:9000/api/update_file + 参数: + {repo_path: "educoder/ca9fvobr.git", + file_path: 'step1/main.py', + message: 'commit by test', + content: 'afdjadsjfj1111', + author_name: 'guange', + author_email: '8863824@gmil.com'} + +5、获取文件内容 + 访问地址:http://121.199.19.206:9000/api/file_content + 参数: + {repo_path: "educoder/ca9fvobr.git", file_path: 'step1/main.py',} + +6、获取提交记录 + 访问地址:http://121.199.19.206:9000/api/commits + 参数: + {repo_path: 比如:"educoder/ca9fvobr.git"} + + diff --git a/lib/gitcheck/shixun_update.txt b/lib/gitcheck/shixun_update.txt new file mode 100644 index 000000000..e69de29bb diff --git a/lib/tasks/git_check.rake b/lib/tasks/git_check.rake new file mode 100644 index 000000000..64f8be91b --- /dev/null +++ b/lib/tasks/git_check.rake @@ -0,0 +1,16 @@ +namespace :git do + desc "检测是否TPM是否需要更新" + task :shixun_check_update => :environment do + + end + + desc "检测版本库是否有异常" + task :myshixuns_check_update => :environment do + + end + + + task :check => :environment do + + end +end