when "add-prj"
if not option[:git].nil? then
BuildServerController.add_project( option[:name], option[:pid],
- option[:git], option[:branch], option[:remote], option[:passwd],
+ option[:git], option[:branch], option[:remote],
option[:os], option[:dist] )
else
BuildServerController.add_binary_project( option[:name], option[:pid],
- option[:package], option[:passwd], option[:os], option[:dist] )
+ option[:package], option[:os], option[:dist] )
end
when "remove-prj"
row, prj_os_list, source_info, package_info = load_row(name, dist_name, db)
prj_id = row['id']
prj_name = row['name']
- prj_passwd = row['password']
prj_status = row['status']
new_project = BinaryUploadProject.new(prj_name, server, prj_os_list, dist_name)
- if not prj_passwd.empty? then new_project.passwd = prj_passwd end
new_project.set_project_id( prj_id )
new_project.set_source_info( source_info )
new_project.set_package_info( package_info )
require 'utils'
class BuildClientUsage
- BUILD="build-cli build -N <project name> -d <server address> [-o <os>] [-w <password>] [--async] [-D <distribution name>] [-U user-email] [--save]"
+ BUILD="build-cli build -N <project name> -d <server address> -U <user-id> -w <user-password> [-o <os>] [--async] [-D <distribution name>] [--save]"
QUERY="build-cli query -d <server address>"
QUERY_SYSTEM="build-cli query-system -d <server address>"
QUERY_PROJECT="build-cli query-project -d <server address>"
QUERY_JOB="build-cli query-job -d <server address>"
QUERY_LOG="build-cli query-log -d <server address> -j <job number> [--output <output file path>]"
- CANCEL="build-cli cancel -j <job number> -d <server address> [-w <password>] [-U user-email]"
- REGISTER="build-cli register -P <package file> -d <server address> [-t <ftp server url>] [-w <password>] [-D <distribution name>] [-U user-email]"
+ CANCEL="build-cli cancel -j <job number> -d <server address> -U user-id -w <user-password>"
+ REGISTER="build-cli register -P <package file> -d <server address> -U user-id -w <user-password> [-t <ftp server url>] [-D <distribution name>]"
end
when "build" then
if options[:project].nil? or options[:project].empty? or
- options[:domain].nil? or options[:domain].empty? then
+ options[:domain].nil? or options[:domain].empty? or
+ options[:passwd].nil? or options[:passwd].empty? or
+ options[:user].nil? or options[:user].empty? then
raise ArgumentError, "Usage: " + BuildClientUsage::BUILD
end
when "cancel" then
if options[:job].nil? or options[:job].empty? or
- options[:domain].nil? or options[:domain].empty? then
+ options[:domain].nil? or options[:domain].empty? or
+ options[:passwd].nil? or options[:passwd].empty? or
+ options[:user].nil? or options[:user].empty? then
raise ArgumentError, "Usage: " + BuildClientUsage::CANCEL
end
when "register" then
if options[:package].nil? or options[:package].empty? or
- options[:domain].nil? or options[:domain].empty? then
+ options[:domain].nil? or options[:domain].empty? or
+ options[:passwd].nil? or options[:passwd].empty? or
+ options[:user].nil? or options[:user].empty? then
raise ArgumentError, "Usage: " + BuildClientUsage::REGISTER
end
end
options[:passwd] = ""
- opts.on( '-w', '--passwd <password>', 'password for managing project' ) do|passwd|
+ opts.on( '-w', '--passwd <user-password>', 'user password' ) do|passwd|
options[:passwd] = passwd
end
options[:fdomain] = domain
end
- options[:user] = "admin@user"
+ options[:user] = ""
opts.on( '-U', '--user <user email>', 'user email infomation' ) do|user|
options[:user] = user
end
if @status == "REMOTE_WORKING" then
client = BuildCommClient.create( @remote_server.ip, @remote_server.port, @log )
if not client.nil? then
- client.send "CANCEL|#{@remote_id}|#{self.get_project.passwd}|admin@user"
+ client.send "CANCEL|#{@remote_id}||"
result1 = client.receive_data()
if result1.nil? then
@log.info( "cancel operation failed [connection error] !!", Log::LV_USER)
require 'fileutils'
require 'dbi'
require 'thread'
+require 'bcrypt'
require 'file/tail'
$LOAD_PATH.unshift File.dirname(__FILE__)
$LOAD_PATH.unshift File.dirname(File.dirname(__FILE__))+"/common"
@db_dsn = nil
@db_user = nil
@db_passwd = nil
- @db_version = 4
+ @db_version = 5
@sqlite3_db_mutex = Mutex.new
#DB upgrade SQL command
"ALTER TABLE jobs ADD COLUMN error_code VARCHAR(32)",
"INSERT INTO users (name,email,password_hash,password_salt) VALUES ('sync-manager','sync-manager@user','$2a$10$H.w3ssI9KfuvNEXXp1qxD.b3Wm8alJG.HXviUofe4nErDn.TKUAka','$2a$10$H.w3ssI9KfuvNEXXp1qxD.')",
"INSERT INTO user_groups (user_id, group_id) SELECT users.id,groups.id FROM users,groups WHERE users.email = 'sync-manager@user' and groups.name = 'admin'",
- "INSERT INTO server_configs (property,value) VALUES ('max_jobs','4')"
- ]
+ "INSERT INTO server_configs (property,value) VALUES ('max_jobs','4')"]
+ @db_migrate[4]=["ALTER TABLE projects DROP COLUMN password"]
else
@db_migrate[1]=["ALTER TABLE distributions ADD pkgsvr_password VARCHAR(64)"]
@db_migrate[2]=["ALTER TABLE projects ADD COLUMN status VARCHAR(32) NOT NULL DEFAULT 'OPEN'"]
"ALTER TABLE jobs ADD COLUMN error_code VARCHAR(32)",
"INSERT INTO users (name,email,password_hash,password_salt) VALUES ('sync-manager','sync-manager@user','$2a$10$H.w3ssI9KfuvNEXXp1qxD.b3Wm8alJG.HXviUofe4nErDn.TKUAka','$2a$10$H.w3ssI9KfuvNEXXp1qxD.')",
"INSERT INTO user_groups (user_id, group_id) SELECT users.id,groups.id FROM users,groups WHERE users.email = 'sync-manager@user' and groups.name = 'admin'",
- "INSERT INTO server_configs (property,value) VALUES ('max_jobs','4')"
- ]
+ "INSERT INTO server_configs (property,value) VALUES ('max_jobs','4')"]
+ @db_migrate[4]=["ALTER TABLE projects DROP COLUMN password"]
end
end
return -1
end
+ def check_user_password(user_id, passwd)
+ get_db_connection() do |db|
+ row = db.select_one("SELECT * FROM users WHERE id='#{user_id}'")
+ if not row.nil? then
+ if row['password_hash'].eql? passwd
+ # if passwd is encript and that value equal password_hash then return true
+ return 1
+ else
+ return row['password_hash'] == BCrypt::Engine.hash_secret(passwd, row['password_salt'])
+ end
+ else
+ return -1
+ end
+ end
+
+ return -1
+ end
+
def qualify_admin_to_access(prj_id)
# nothing to do, admin can change everything on web admin tool
# add project
def self.add_project( id, project_name, git_repos, git_branch, remote_server_id,
- passwd, os_string, dist_name )
+ os_string, dist_name )
server = get_server(id)
if not server.has_db? then
dist_name = check_distribution_name(dist_name, server)
if dist_name.nil? then return false end
- result = server.prjmgr.add_git_project( project_name, git_repos, git_branch, passwd, os_list, dist_name )
+ result = server.prjmgr.add_git_project( project_name, git_repos, git_branch, os_list, dist_name )
if result then
puts "Adding project succeeded!"
return true
# add binary project
- def self.add_binary_project( id, project_name, pkg_name, passwd, os_string, dist_name )
+ def self.add_binary_project( id, project_name, pkg_name, os_string, dist_name )
server = get_server(id)
if not server.has_db? then
if dist_name.nil? then return false end
# add
- result = server.prjmgr.add_binary_project( project_name, pkg_name, passwd,
+ result = server.prjmgr.add_binary_project( project_name, pkg_name,
os_list, dist_name )
if result then
puts "Adding project succeeded!"
"ERR008" => "Distribution locked!",
"ERR009" => "Project not found!",
"ERR010" => "Build operation not allowed on this project type!",
- "ERR011" => "Project password required!",
- "ERR012" => "Project password not matched!",
+ "ERR011" => "User password not matched!",
+
"ERR013" => "Project from file-name/distribution not found!",
"ERR014" => "Job cancel failed!",
"ERR015" => "Server password not matched!",
UNLOCK_DIST="build-svr unlock-dist -n <server name> -D <distribution name>"
ADD_SYNC="build-svr add-sync -n <server name> -u <remote pkg server url> [--dist <distribution>]"
REMOVE_SYNC="build-svr remove-sync -n <server name> -u <remote pkg server url> [--dist <distribution>]"
- ADD_PRJ="build-svr add-prj -n <server name> -N <project name> (-g <git repository> -b <git branch>|-P <package name>) [-w <password>] [-o <os list>] [--dist <distribution>]"
+ ADD_PRJ="build-svr add-prj -n <server name> -N <project name> (-g <git repository> -b <git branch>|-P <package name>) [-o <os list>] [--dist <distribution>]"
REMOVE_PRJ="build-svr remove-prj -n <server name> -N <project name> [--dist <distribution>]"
REGISTER="build-svr register -n <server name> -P <package file> [--dist <distribution>]"
QUERY="build-svr query -n <server name>"
$LOAD_PATH.unshift File.dirname(File.dirname(__FILE__))+"/common"
class CommonProject
- attr_accessor :name, :type, :passwd, :os_list, :dist_name, :path, :status
+ attr_accessor :name, :type, :os_list, :dist_name, :path, :status
# initialize
def initialize( name, type, server, os_list, dist_name="BASE", status="OPEN" )
@name = name
end
@type = type
- @passwd = ""
@os_list = os_list
@server = server
@dist_name = dist_name
end
- #return passwd
- def is_passwd_set?()
- return ( not @passwd.empty? )
- end
-
-
- def passwd_match?(word)
- if not is_passwd_set? then return true end
-
- if word.eql? @passwd then
- return true
- else
- return false
- end
- end
-
-
def set_source_info(info)
@source_info = info
end
user_id INTEGER,
name VARCHAR(32) NOT NULL,
ptype VARCHAR(32) NOT NULL,
- password VARCHAR(32),
status VARCHAR(32) NOT NULL DEFAULT 'OPEN',
CONSTRAINT fk_projects_users1 FOREIGN KEY ( user_id ) REFERENCES users ( id ),
CONSTRAINT fk_projects_distributions1 FOREIGN KEY ( distribution_id ) REFERENCES distributions ( id ) )#{post_fix}"
if @prj_id == -1 then
row = db.select_one("SELECT * FROM distributions WHERE name='#{@dist_name}'")
dist_id = row['id']
- db.do "INSERT INTO projects (distribution_id,name,ptype,password,status)
- VALUES (#{dist_id},'#{@name}','#{@type}','#{@passwd}','#{@status}')"
+ db.do "INSERT INTO projects (distribution_id,name,ptype,status)
+ VALUES (#{dist_id},'#{@name}','#{@type}','#{@status}')"
case @server.db_dsn
when /^SQLite3:/ then @prj_id = db.select_one("select last_insert_rowid()")[0]
when /^Mysql:/ then @prj_id = db.func(:insert_id)
else
row = db.select_one("SELECT * FROM distributions WHERE name='#{@dist_name}'")
dist_id = row['id']
- db.do "UPDATE projects SET ptype='#{@type}',password='#{@passwd}',status='#{@status}' WHERE name='#{@name}' and distribution_id=#{dist_id})"
+ db.do "UPDATE projects SET ptype='#{@type}',status='#{@status}' WHERE name='#{@name}' and distribution_id=#{dist_id})"
db.do "DELETE FROM project_os WHERE project_id=#{@prj_id}"
@os_list.each do |os|
row = db.select_one("SELECT * FROM supported_os WHERE name='#{os}'")
public
def self.get_project_from_pkg_name_row(pkg_name, dist_name, db)
- return db.select_one("SELECT projects.id,projects.distribution_id,projects.name,projects.ptype,projects.password
+ return db.select_one("SELECT projects.id,projects.distribution_id,projects.name,projects.ptype
FROM distributions,projects,project_bins
WHERE distributions.name='#{dist_name}' and
distributions.id = projects.distribution_id and
prj_id = row['id']
prj_name = row['name']
- prj_passwd = row['password']
prj_status = row['status']
new_project = GitBuildProject.new(prj_name, server, prj_os_list, dist_name)
- if not prj_passwd.empty? then new_project.passwd = prj_passwd end
new_project.set_project_id( prj_id )
new_project.set_source_info( source_info )
new_project.set_package_info( package_info )
end
- def add_git_project(name, repos, branch, passwd, os_list, dist_name)
+ def add_git_project(name, repos, branch, os_list, dist_name)
new_prj = nil
result = @server.get_db_connection() do |db|
prj = get_project_internal(name, dist_name, db)
# create new object
new_prj = GitBuildProject.new(name, @server, os_list, dist_name, repos, branch)
- if not passwd.nil? and not passwd.empty? then
- new_prj.passwd = passwd
- end
# save to db
new_prj.save(db)
end
- def add_binary_project(name, pkg_name, passwd, os_list, dist_name)
+ def add_binary_project(name, pkg_name, os_list, dist_name)
new_prj = nil
result = @server.get_db_connection() do |db|
prj = get_project_internal(name, dist_name, db)
# create new object
new_prj = BinaryUploadProject.new(name, @server, os_list, dist_name, pkg_name)
- if not passwd.nil? and not passwd.empty? then
- new_prj.passwd = passwd
- end
# save to db
new_prj.save(db)
options[:noreverse] = false
options[:local_pkgs] = []
options[:dist] = nil
- options[:user] = "admin@user"
+ options[:user] = nil
options[:is_rev_build] = false
options[:rebuild] = false
options[:save] = false
# parse
project_name_list = tok[2].split(",")
- passwd_list = tok[3].split(",")
- passwd = passwd_list[0]
+ passwd = tok[3]
os_list = tok[4].split(",")
async = tok[5].eql? "YES"
no_reverse = tok[6].eql? "YES"
end
end
+ # check user psssword
+ if not is_internal and not @parent_server.check_user_password(user_id, passwd) then
+ raise BuildServerException.new("ERR011"), "Email : #{user_email} && Password : #{passwd}"
+ end
+
# multi build job
if project_name_list.count > 1 or os_list.count > 1 then
new_job_list = []
i = 0
project_name_list.each do |pname|
- if not passwd_list[i].nil? then passwd = passwd_list[i]
- else passwd = passwd_list[0] end
- check_build_project(pname,passwd,dist_name,req)
+ check_build_project(pname,dist_name,req)
if not check_project_user_id(pname,dist_name,user_id) then
raise BuildServerException.new("ERR005"), "#{user_email} -> #{pname}"
end
pname = project_name_list[0]
os = os_list[0]
- check_build_project(pname,passwd,dist_name,req)
+ check_build_project(pname,dist_name,req)
if not check_project_user_id(pname,dist_name,user_id) then
raise BuildServerException.new("ERR005"), "#{user_email} -> #{pname}"
end
end
- def check_build_project(prj_name, passwd, dist_name, req)
+ def check_build_project(prj_name, dist_name, req)
# check project
prj = check_project_exist(prj_name, dist_name, req)
raise BuildServerException.new("ERR017"), "#{prj_name} on #{dist_name}. project is [[#{prj.status}]]"
end
- # check passwd
- check_project_password(prj, passwd, req)
-
# check project type
if prj.type == "BINARY" then
raise BuildServerException.new("ERR010"), prj.type
def handle_cmd_cancel_internal( line, req )
tok = line.split("|").map { |x| x.strip }
- if tok.count < 2 then
+ if tok.count < 4 then
raise BuildServerException.new("ERR001"), line
end
cancel_job = nil
- # check user email
- user_id = @parent_server.check_user_id_from_email( tok[3] )
- if user_id == -1 then
- raise BuildServerException.new("ERR004"), tok[3]
- end
+ job_number = tok[1]
+ user_password = tok[2]
+ user_email = tok[3]
#CANCEL, JOB
(@parent_server.jobmgr.jobs + @parent_server.jobmgr.internal_jobs + @parent_server.jobmgr.reverse_build_jobs).each do |j|
- if "#{j.id}" == "#{tok[1]}" then
+ if "#{j.id}" == "#{job_number}" then
cancel_job = j
break
end
end
if cancel_job.nil? then
- raise BuildServerException.new("ERR014"), "Job #{tok[1]} not found."
+ raise BuildServerException.new("ERR014"), "Job #{job_number} not found."
end
if cancel_job.event != "NONE" then
raise BuildServerException.new("ERR014"), "Job already canceled."
end
- # check passwd
- if not @parent_server.jobmgr.is_user_accessable(cancel_job,user_id) then
- raise BuildServerException.new("ERR014"), "Access denied #{tok[3]}"
+ if not cancel_job.is_transferred? then
+ # check user email
+ user_id = @parent_server.check_user_id_from_email(user_email)
+ if user_id == -1 then
+ raise BuildServerException.new("ERR004"), user_email
+ end
+
+ # check user psssword
+ if not @parent_server.check_user_password(user_id, user_password) then
+ raise BuildServerException.new("ERR011"), "Email : #{user_email} && Password : #{passwd}"
+ end
+
+ # check project accessable
+ if not @parent_server.jobmgr.is_user_accessable(cancel_job,user_id) then
+ raise BuildServerException.new("ERR014"), "Access denied #{user_email}"
+ end
end
if cancel_job.type == "MULTIBUILD" then
sub_projects = cancel_job.get_sub_jobs().map{|sub| sub.get_project }
- check_multi_project_password(sub_projects,tok[2],req)
-
BuildCommServer.send(req, "\"#{cancel_job.id}, #{cancel_job.get_sub_jobs().map{|x| x.id}.join(", ")}\" will be canceled")
else
raise BuildServerException.new("ERR014"), "No project infomation"
end
- check_project_password( prj, tok[2], req)
-
BuildCommServer.send(req, "\"#{cancel_job.id}\" will be canceled")
end
raise BuildServerException.new("ERR004"), user_email
end
+ # check user psssword
+ if not @parent_server.check_user_password(user_id, passwd) then
+ raise BuildServerException.new("ERR011"), "Email : #{user_email} && Password : #{passwd}"
+ end
+
if not check_project_pkg_name_user_id(filename, dist_name, user_id) then
raise BuildServerException.new("ERR005"), "#{user_email} -> #{prj.name}"
end
- # check passwd
- check_project_password(prj, passwd, req)
-
# save thread and wait uplaod
BuildCommServer.send(req, "WAITFORUPLOAD")
req_line = req.gets
end
private
- def check_multi_project_password(prj_list, passwd, req)
-
- if prj_list.select{|prj| not prj.is_passwd_set?}.empty? then
- if passwd.nil? or passwd.empty? then
- raise BuildServerException.new("ERR011"), "Use -w option to input your project password"
- end
-
- if prj_list.select{|prj| prj.passwd_match?(passwd) }.empty? then
- raise BuildServerException.new("ERR012"), ""
- end
- end
- end
-
- private
- def check_project_password(prj, passwd, req)
-
- if prj.is_passwd_set? then
- if passwd.nil? or passwd.empty? then
- raise BuildServerException.new("ERR011"), "Use -w option to input your project password"
- end
-
- if not prj.passwd_match?(passwd) then
- raise BuildServerException.new("ERR012"), ""
- end
- end
- end
-
-
- private
def check_distribution(dist_name, req, only_exist = false)
dist = @parent_server.distmgr.get_distribution(dist_name)
if dist.nil? then
register Register the package to the build-server.
Subcommand usage:
-build-cli build -N <project name> -d <server address> [-o <os>] [-w <password>] [--async] [-D <distribution name>] [-U user-email] [--save]
+build-cli build -N <project name> -d <server address> -U <user-id> -w <user-password> [-o <os>] [--async] [-D <distribution name>] [--save]
build-cli query -d <server address>
build-cli query-system -d <server address>
build-cli query-project -d <server address>
build-cli query-job -d <server address>
build-cli query-log -d <server address> -j <job number> [--output <output file path>]
-build-cli cancel -j <job number> -d <server address> [-w <password>] [-U user-email]
-build-cli register -P <package file> -d <server address> [-t <ftp server url>] [-w <password>] [-D <distribution name>] [-U user-email]
+build-cli cancel -j <job number> -d <server address> -U user-id -w <user-password>
+build-cli register -P <package file> -d <server address> -U user-id -w <user-password> [-t <ftp server url>] [-D <distribution name>]
Options:
-N, --project <project name> project name
--async asynchronous job
--save save the files built from remote server
-j, --job <job number> job number
--w, --passwd <password> password for managing project
+-w, --passwd <user-password> user password
-P, --pkg <package file> package file path
-D, --dist <distribution name> distribution name
-t, --ftp <ftp server url> ftp server url: ftp://dibsftp:dibsftp@127.0.0.1
--U, --user <user email> user email infomation
+-U, --user <user email> user email
--output <output_path> output file path
-h, --help display help
-v, --version display version
#PRE-EXEC
#EXEC
-../../build-cli build -N testa -d 127.0.0.1:2223 -o ubuntu-32
+../../build-cli build -N testa -d 127.0.0.1:2223 -o ubuntu-32 -u admin@user -w 1234
#POST-EXEC
#EXPECT
Info: Added new job
#PRE-EXEC
#EXEC
-../../build-cli build -N non_exist_project -d 127.0.0.1:2223 -o ubuntu-32
+../../build-cli build -N non_exist_project -d 127.0.0.1:2223 -o ubuntu-32 -U admin@user -w 1234
#POST-EXEC
#EXPECT
Error: Project not found!: non_exist_project on unstable
#PRE-EXEC
#EXEC
-../../build-cli build -N testa -d 127.0.0.1:11113 -o ubuntu-32
+../../build-cli build -N testa -d 127.0.0.1:11113 -o ubuntu-32 -U admin@user -w 1234
#POST-EXEC
#EXPECT
Error: Connection failed!: 127.0.0.1:11113
#PRE-EXEC
#EXEC
-../../build-cli build -N testa -d 111.11q.111.111:1111 -o ubuntu-32
+../../build-cli build -N testa -d 111.11q.111.111:1111 -o ubuntu-32 -U admin@user -w 1234
#POST-EXEC
#EXPECT
Error: Connection failed!: 111.11q.111.111:1111
#PRE-EXEC
echo "testa project is already built and uploaded in previeous testcase"
#EXEC
-../../build-cli build -N testa -d 127.0.0.1:2223 -o ubuntu-32
+../../build-cli build -N testa -d 127.0.0.1:2223 -o ubuntu-32 -U admin@user -w 1234
#POST-EXEC
#EXPECT
Info: Added new job
#PRE-EXEC
echo "Assume testa project is already built and uploaded in previeous testcase"
#EXEC
-../../build-cli build -N testb -d 127.0.0.1:2223 -o ubuntu-32
+../../build-cli build -N testb -d 127.0.0.1:2223 -o ubuntu-32 -U admin@user -w 1234
#POST-EXEC
#EXPECT
Info: Added new job
../../pkg-svr remove-pkg -n pkgsvr01 -d unstable -P b
../../pkg-svr remove-pkg -n pkgsvr01 -d unstable -P a
#EXEC
-../../build-cli build -N testb -d 127.0.0.1:2223 -o ubuntu-32
+../../build-cli build -N testb -d 127.0.0.1:2223 -o ubuntu-32 -U admin@user -w 1234
#POST-EXEC
#EXPECT
Info: Added new job
echo "This is the test case for omitting os"
../../pkg-svr remove-pkg -n pkgsvr01 -d unstable -P a
#EXEC
-../../build-cli build -N testa -d 127.0.0.1:2223
+../../build-cli build -N testa -d 127.0.0.1:2223 -U admin@user -w 1234
#POST-EXEC
#EXPECT
Info: Added new job
#PRE-EXEC
echo "if there doe not exist server to build, error"
#EXEC
-../../build-cli build -N testa -d 127.0.0.1:2223 -o windows-32
+../../build-cli build -N testa -d 127.0.0.1:2223 -o windows-32 -U admin@user -w 1234
#POST-EXEC
#EXPECT
Info: Added new job
echo "wrong os name in build command"
../../pkg-svr remove-pkg -n pkgsvr01 -d unstable -P a
#EXEC
-../../build-cli build -N testa -d 127.0.0.1:2223 -o wrong_os_name
+../../build-cli build -N testa -d 127.0.0.1:2223 -o wrong_os_name -U admin@user -w 1234
#POST-EXEC
#EXPECT
Error: Unsupported OS name used!: wrong_os_name... Use a name in (ubuntu-32|windows-32)
#PRE-EXEC
echo "wrong os name in resolve command"
#EXEC
-../../build-cli resolve -N testa -d 127.0.0.1:2223 -o wrong_os_name
+../../build-cli resolve -N testa -d 127.0.0.1:2223 -o wrong_os_name -U admin@user -w 1234
#POST-EXEC
#EXPECT
Error: Unsupported OS name used!: wrong_os_name
echo "Assume that testa,testb which are depended by testc are built and uploaded"
echo "For, work around solution, removed cache"
rm -rf buildsvr01/projects/testa/cache
-../../build-cli build -N testa -d 127.0.0.1:2223 -o ubuntu-32
-../../build-cli build -N testb -d 127.0.0.1:2223 -o ubuntu-32
+../../build-cli build -N testa -d 127.0.0.1:2223 -o ubuntu-32 -U admin@user -w 1234
+../../build-cli build -N testb -d 127.0.0.1:2223 -o ubuntu-32 -U admin@user -w 1234
#EXEC
-../../build-cli build -N testc -d 127.0.0.1:2223 -w 1111 -o ubuntu-32
+../../build-cli build -N testc -d 127.0.0.1:2223 -w 1111 -o ubuntu-32 -U admin@user -w 1234
#POST-EXEC
#EXPECT
Info: Added new job
echo "Assume that testc project has the password (1111)"
echo "Assume that testa,testb which are depended by testc are built and uploaded"
#EXEC
-../../build-cli build -N testc -d 127.0.0.1:2223 -o ubuntu-32
+../../build-cli build -N testc -d 127.0.0.1:2223 -o ubuntu-32 -U admin@user
#POST-EXEC
#EXPECT
-Error: Project password required!: Use -w option to input your project password
+Usage: build-cli build -N <project name> -d <server address> -U <user-id> -w <user-password> [-o <os>] [--async] [-D <distribution name>] [--save]
echo "Assume that testc project has the password (1111)"
echo "Assume that testa,testb which are depended by testc are built and uploaded"
#EXEC
-../../build-cli build -N testc -d 127.0.0.1:2223 -w 2222 -o ubuntu-32
+../../build-cli build -N testc -d 127.0.0.1:2223 -w 2222 -o ubuntu-32 -U admin@user -w 1111
#POST-EXEC
#EXPECT
-Error: Project password not matched!
+Error: User password not matched!: Email : admin@user && Password : 1111
#PRE-EXEC
../pkg-svr remove-pkg -n pkgsvr01 -d unstable -P c
#EXEC
-../../build-cli build -N testc -d 127.0.0.1:2223 -w 1111 --async -o ubuntu-32
+../../build-cli build -N testc -d 127.0.0.1:2223 -w 1111 --async -o ubuntu-32 -U admin@user -w 1234
#POST-EXEC
#EXPECT
Info: Added new job
../../pkg-svr remove-pkg -n pkgsvr01 -d unstable -P b
../../pkg-svr remove-pkg -n pkgsvr01 -d unstable -P a
#EXEC
-../../build-cli build -N testa -d 127.0.0.1:2223 --async -o ubuntu-32
+../../build-cli build -N testa -d 127.0.0.1:2223 --async -o ubuntu-32 -U admin@user -w 1234
sleep 1
-../../build-cli build -N testb -d 127.0.0.1:2223 -o ubuntu-32
+../../build-cli build -N testb -d 127.0.0.1:2223 -o ubuntu-32 -U admin@user -w 1234
#POST-EXEC
#EXPECT
Info: Added new job
#EXEC
rm -rf git01/a
cd git01;tar xf a_v2.tar.gz
-../../build-cli build -N testa -d 127.0.0.1:2223 -o ubuntu-32
+../../build-cli build -N testa -d 127.0.0.1:2223 -o ubuntu-32 -U admin@user -w 1234
#POST-EXEC
#EXPECT
Info: Added new job
rm -rf git01/c
cd git01;tar xf c_v1_1.tar.gz
#EXEC
-../../build-cli build -N testc -d 127.0.0.1:2223 -o ubuntu-32 -w 1111
+../../build-cli build -N testc -d 127.0.0.1:2223 -o ubuntu-32 -w 1111 -U admin@user -w 1234
#POST-EXEC
#EXPECT
Info: Added new job
cd git01;tar xf b_v2.tar.gz
cd git01;tar xf c_v2.tar.gz
#EXEC
-../../build-cli build -N testa,testb,testc -d 127.0.0.1:2223 -o ubuntu-32 -w 1111
+../../build-cli build -N testa,testb,testc -d 127.0.0.1:2223 -o ubuntu-32 -U admin@user -w 1234
#POST-EXEC
#EXPECT
Info: Added new job
#PRE-EXEC
echo "This test case must be execute right after testcase 22"
#EXEC
-../../build-cli build -N testa,testb,testc -d 127.0.0.1:2223 -o ubuntu-32 -w 1111
+../../build-cli build -N testa,testb,testc -d 127.0.0.1:2223 -o ubuntu-32 -U admin@user -w 1234
#POST-EXEC
#EXPECT
Info: Added new job
#PRE-EXEC
cd git01;tar xf a_v3.tar.gz
#EXEC
-../../build-cli build -N testa -d 127.0.0.1:2223 -o ubuntu-32,windows-32
+../../build-cli build -N testa -d 127.0.0.1:2223 -o ubuntu-32,windows-32 -U admin@user -w 1234
#POST-EXEC
#EXPECT
Info: Added new job
cd git01;tar xf b_v4.tar.gz
cd git01;tar xf c_v4.tar.gz
#EXEC
-../../build-cli build -N testa,testb,testc,testa1,testd -o all --rebuild -d 127.0.0.1:2223 -w ,,1111,,
+../../build-cli build -N testa,testb,testc,testa1,testd -o all --rebuild -d 127.0.0.1:2223 -U admin@user -w 1234
#POST-EXEC
#EXPECT
Info: Added new job
#PRE-EXEC
cd git01;tar xf c_v5.tar.gz
#EXEC
-../../build-cli build -N testc -d 127.0.0.1:2223 -o li_* -w 1111
+../../build-cli build -N testc -d 127.0.0.1:2223 -o li_* -U admin@user -w 1234
#POST-EXEC
#EXPECT
Error: Unsupported OS name used!: There is no OS name matched.
#PRE-EXEC
echo "wild card"
#EXEC
-../../build-cli build -N testc -d 127.0.0.1:2223 -o ubuntu-* -w 1111
+../../build-cli build -N testc -d 127.0.0.1:2223 -o ubuntu-* -U admin@user -w 1234
#POST-EXEC
#EXPECT
Info: Added new job
#EXEC
rm -rf git01/a
cd git01;tar xf a_v5.tar.gz
-../../build-cli build -N testa -d 127.0.0.1:2223 -o ubuntu-32
+../../build-cli build -N testa -d 127.0.0.1:2223 -o ubuntu-32 -U admin@user -w 1234
#POST-EXEC
#EXPECT
Info: Added new job
#PRE-EXEC
echo "user check"
#EXEC
-../../build-cli build -N testa -d 127.0.0.1:2223 -o ubuntu-32 -U xxuser@user
+../../build-cli build -N testa -d 127.0.0.1:2223 -o ubuntu-32 -U xxuser@user -w 1234
#POST-EXEC
#EXPECT
Error: User account not found!: xxuser@user
#PRE-EXEC
echo "This case will test --save option"
#EXEC
-../../build-cli build -N testa -d 127.0.0.1:2223 -o ubuntu-32 --save --rebuild
+../../build-cli build -N testa -d 127.0.0.1:2223 -o ubuntu-32 --save --rebuild -U admin@user -w 1234
#POST-EXEC
#EXPECT
Info: Added new job
#PRE-EXEC
echo "This case will test --save option for MULTI build job"
#EXEC
-../../build-cli build -N testa,testb -d 127.0.0.1:2223 -o ubuntu-32 --save --rebuild
+../../build-cli build -N testa,testb -d 127.0.0.1:2223 -o ubuntu-32 --save --rebuild -U admin@user -w 1234
#POST-EXEC
#EXPECT
Info: Added new job
#PRE-EXEC
echo "This case will test --noreverse option"
#EXEC
-../../build-cli build -N testa -d 127.0.0.1:2223 -o ubuntu-32 --rebuild --noreverse
+../../build-cli build -N testa -d 127.0.0.1:2223 -o ubuntu-32 --rebuild --noreverse -U admin@user -w 1234
#POST-EXEC
#EXPECT
Info: Added new job
#PRE-EXEC
echo "This case will check redundent job"
-../../build-cli build -N testa -d 127.0.0.1:2223 -o ubuntu-32 --rebuild &
+../../build-cli build -N testa -d 127.0.0.1:2223 -o ubuntu-32 --rebuild -U admin@user -w 1234 &
#EXEC
sleep 2
-../../build-cli build -N testa -d 127.0.0.1:2223 -o ubuntu-32 --rebuild
+../../build-cli build -N testa -d 127.0.0.1:2223 -o ubuntu-32 --rebuild -U admin@user -w 1234
#POST-EXEC
#EXPECT
Info: Added new job
${RUBY} ../../build-svr add-os -n testserver3 -o windows-32
${RUBY} ../../build-svr add-prj -n testserver3 -N testa -g `pwd`/git01/a -b master
${RUBY} ../../build-svr add-prj -n testserver3 -N testb -g `pwd`/git01/b -b master
-${RUBY} ../../build-svr add-prj -n testserver3 -N testc -g `pwd`/git01/c -b master -w 1111
+${RUBY} ../../build-svr add-prj -n testserver3 -N testc -g `pwd`/git01/c -b master
${RUBY} ../../build-svr add-prj -n testserver3 -N testd -g `pwd`/git01/d -b master -o ubuntu-32
${RUBY} ../../build-svr add-prj -n testserver3 -N teste -P bin
${RUBY} ../../build-svr add-prj -n testserver3 -N testa1 -g `pwd`/git01/a1 -b master
#PRE-EXEC
#EXEC
-../../build-cli build -N testa -d 127.0.0.1:2223 -o ubuntu-32 -D unstable
+../../build-cli build -N testa -d 127.0.0.1:2223 -o ubuntu-32 -D unstable -U admin@user -w 1234
#POST-EXEC
#EXPECT
Info: Added new job
#PRE-EXEC
#EXEC
-../../build-cli build -N testb -d 127.0.0.1:2223 -o ubuntu-32 -D unstable
+../../build-cli build -N testb -d 127.0.0.1:2223 -o ubuntu-32 -D unstable -U admin@user -w 1234
#POST-EXEC
#EXPECT
Info: Added new job
#PRE-EXEC
#EXEC
-../../build-cli build -N testa,testb -d 127.0.0.1:2223 -o ubuntu-32 -D unstable --rebuild
+../../build-cli build -N testa,testb -d 127.0.0.1:2223 -o ubuntu-32 -D unstable --rebuild -U admin@user -w 1234
#POST-EXEC
#EXPECT
Info: Added new job
#PRE-EXEC
#EXEC
-../../build-svr register -n testserver3 -D unstable -P bin/bin_0.0.0_ubuntu-32.zip
+../../build-svr register -n testserver3 -D unstable -P bin/bin_0.0.0_ubuntu-32.zip
#POST-EXEC
#EXPECT
Info: Added new job
#PRE-EXEC
#EXEC
-../../build-cli build -N testa -d 127.0.0.1:2223 -D unstable
-../../build-cli build -N testa -d 127.0.0.1:2223 -D unstable2
+../../build-cli build -N testa -d 127.0.0.1:2223 -D unstable -U admin@user -w 1234
+../../build-cli build -N testa -d 127.0.0.1:2223 -D unstable2 -U admin@user -w 1234
#POST-EXEC
#EXPECT
Info: Added new job
#PRE-EXEC
#EXEC
-../../build-cli register -d 127.0.0.1:2223 -P bin/bin_0.0.0_ubuntu-32.zip -D unstable2 #-t ftp://ftpuser:ftpuser@127.0.0.1
+../../build-cli register -d 127.0.0.1:2223 -P bin/bin_0.0.0_ubuntu-32.zip -D unstable2 -U admin@user -w 1234 #-t ftp://ftpuser:ftpuser@127.0.0.1
#POST-EXEC
#EXPECT
I, [
#PRE-EXEC
#EXEC
-../../build-cli build -d 127.0.0.1:2223 -N testa,testb -o all -D unstable2 --rebuild
+../../build-cli build -d 127.0.0.1:2223 -N testa,testb -o all -D unstable2 --rebuild -U admin@user -w 1234
#POST-EXEC
#EXPECT
Info: Added new job
echo "=="
../../build-svr lock-dist -n testserver3 -D unstable2
echo "=="
-../../build-cli build -N testb -d 127.0.0.1:2223 -D unstable2
+../../build-cli build -N testb -d 127.0.0.1:2223 -D unstable2 -U admin@user -w 1234
echo "=="
../../build-svr unlock-dist -n testserver3 -D unstable2
echo "=="
-../../build-cli build -N testb -d 127.0.0.1:2223 -D unstable2
+../../build-cli build -N testb -d 127.0.0.1:2223 -D unstable2 -U admin@user -w 1234
#POST-EXEC
#EXPECT
==
#PRE-EXEC
echo "Will check duplicated registration"
-../../build-svr register -n testserver3 -D unstable -P bin/bin_0.0.1_ubuntu-32.zip &
+../../build-svr register -n testserver3 -D unstable -P bin/bin_0.0.1_ubuntu-32.zip &
#EXEC
sleep 1
-../../build-svr register -n testserver3 -D unstable -P bin/bin_0.0.1_ubuntu-32.zip
+../../build-svr register -n testserver3 -D unstable -P bin/bin_0.0.1_ubuntu-32.zip
#POST-EXEC
#EXPECT
Info: Added new job