From 30ec8ec30580b8a0993cc9c4f7fbb0e3ff76c0b6 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Tue, 4 Jul 2017 23:31:23 -0400 Subject: [PATCH 01/14] CI: change the user to common user --- .travis.yml | 3 ++- travis.pl | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index b0ea8fb8d..a04874d6c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,8 @@ script: - echo $GITHUB_TOKEN - git log --pretty=format:"%s %b" -2 -- perl travis.pl +#- perl travis.pl +- if [ $TRAVIS_EVENT_TYPE == "pull_request" ]; then perl ./travis.pl; fi diff --git a/travis.pl b/travis.pl index 4c827769a..7ca5563fe 100644 --- a/travis.pl +++ b/travis.pl @@ -157,8 +157,8 @@ sub send_back_comment{ } print "[send_back_comment] method = $post_method to $post_url \n"; - #`curl -u "$ENV{'USERNAME'}:$ENV{'PASSWORD'}" -X $post_method -d '{"body":"$message"}' $post_url 2>&1 > /dev/null`; - `curl -u "denfshuaishuai\@icloud.com:ds18811031107" -X $post_method -d '{"body":"$message"}' $post_url 2>&1 > /dev/null`; + `curl -u "$ENV{'USERNAME'}:$ENV{'PASSWORD'}" -X $post_method -d '{"body":"$message"}' $post_url 2>&1 > /dev/null`; + # `curl -u "denfshuaishuai\@icloud.com:ds18811031107" -X $post_method -d '{"body":"$message"}' $post_url 2>&1 > /dev/null`; } #-------------------------------------------------------- From 426c50ed1d5fc67bad60730b43b231ce797ea977 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Tue, 4 Jul 2017 23:36:25 -0400 Subject: [PATCH 02/14] modify .travis.yml back --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a04874d6c..1ab68ff82 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,8 +22,8 @@ script: - echo $GITHUB_TOKEN - git log --pretty=format:"%s %b" -2 -#- perl travis.pl -- if [ $TRAVIS_EVENT_TYPE == "pull_request" ]; then perl ./travis.pl; fi +- perl travis.pl +#- if [ $TRAVIS_EVENT_TYPE == "pull_request" ]; then perl ./travis.pl; fi From 09e7964b5f352db11e7e8330d321b5998806215e Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Wed, 5 Jul 2017 01:29:21 -0400 Subject: [PATCH 03/14] Using token to instead of user name and password --- travis.pl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/travis.pl b/travis.pl index 7ca5563fe..382c61148 100644 --- a/travis.pl +++ b/travis.pl @@ -157,8 +157,7 @@ sub send_back_comment{ } print "[send_back_comment] method = $post_method to $post_url \n"; - `curl -u "$ENV{'USERNAME'}:$ENV{'PASSWORD'}" -X $post_method -d '{"body":"$message"}' $post_url 2>&1 > /dev/null`; - # `curl -u "denfshuaishuai\@icloud.com:ds18811031107" -X $post_method -d '{"body":"$message"}' $post_url 2>&1 > /dev/null`; + `curl -v -H "Authorization: token 7333caf3936a938ad0803e7a297423e43f69fb62" -X POST -d '{"body":"$message"}' $post_url 2>&1 > /dev/null`; } #-------------------------------------------------------- From 994e811e8eb013968470a8d8230f929ca6715983 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Wed, 5 Jul 2017 01:41:24 -0400 Subject: [PATCH 04/14] test token --- travis.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/travis.pl b/travis.pl index 382c61148..2beb5dccb 100644 --- a/travis.pl +++ b/travis.pl @@ -156,8 +156,8 @@ sub send_back_comment{ } } - print "[send_back_comment] method = $post_method to $post_url \n"; - `curl -v -H "Authorization: token 7333caf3936a938ad0803e7a297423e43f69fb62" -X POST -d '{"body":"$message"}' $post_url 2>&1 > /dev/null`; + print "[send_back_comment] method = $post_method to $post_url by token\n"; + `curl -v -H "Authorization: token 7333caf3936a938ad0803e7a297423e43f69fb62" -X $post_method -d '{"body":"$message"}' $post_url 2>&1 > /dev/null`; } #-------------------------------------------------------- From f356b13e65472ebf7a50a376a8afb8de80e12136 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Wed, 5 Jul 2017 01:47:37 -0400 Subject: [PATCH 05/14] test token 1 --- travis.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis.pl b/travis.pl index 2beb5dccb..857d961be 100644 --- a/travis.pl +++ b/travis.pl @@ -157,7 +157,7 @@ sub send_back_comment{ } print "[send_back_comment] method = $post_method to $post_url by token\n"; - `curl -v -H "Authorization: token 7333caf3936a938ad0803e7a297423e43f69fb62" -X $post_method -d '{"body":"$message"}' $post_url 2>&1 > /dev/null`; + `curl -v -H "Authorization: token 7333caf3936a938ad0803e7a297423e43f69fb62" -X $post_method -d '{"body":"$message"}' $post_url 2>&1`; } #-------------------------------------------------------- From d653535de21a110da13e6d4b258aaa3dca3c1fc7 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Wed, 5 Jul 2017 02:11:23 -0400 Subject: [PATCH 06/14] token test --- travis.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis.pl b/travis.pl index 857d961be..ed3bb1a24 100644 --- a/travis.pl +++ b/travis.pl @@ -157,7 +157,7 @@ sub send_back_comment{ } print "[send_back_comment] method = $post_method to $post_url by token\n"; - `curl -v -H "Authorization: token 7333caf3936a938ad0803e7a297423e43f69fb62" -X $post_method -d '{"body":"$message"}' $post_url 2>&1`; + `curl -v -H "Authorization: token bf43c85ee93d2fc18bd2c8446aa997c54fc2095b" -X $post_method -d '{"body":"$message"}' $post_url 2>&1`; } #-------------------------------------------------------- From c4d221506523e35af4973e502553c211ecb49036 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Wed, 5 Jul 2017 02:18:42 -0400 Subject: [PATCH 07/14] token test1 --- travis.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/travis.pl b/travis.pl index ed3bb1a24..6c5d34b13 100644 --- a/travis.pl +++ b/travis.pl @@ -156,8 +156,9 @@ sub send_back_comment{ } } - print "[send_back_comment] method = $post_method to $post_url by token\n"; - `curl -v -H "Authorization: token bf43c85ee93d2fc18bd2c8446aa997c54fc2095b" -X $post_method -d '{"body":"$message"}' $post_url 2>&1`; + print "[send_back_comment] method = $post_method to $post_url\n"; + `curl -v -H "Authorization: token bf43c85ee93d2fc18bd2c8446aa997c54fc2095b" -X $post_method -d '{"body":"$message"}' $post_url`; + #`curl -v -H "Authorization: token $ENV{'xcatbottoken'}" -X $post_method -d '{"body":"$message"}' $post_url`; } #-------------------------------------------------------- From aa42aca6bab590e98b277de6aff04c7ee7ae0caf Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Wed, 5 Jul 2017 02:34:08 -0400 Subject: [PATCH 08/14] using username and password back --- travis.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/travis.pl b/travis.pl index 6c5d34b13..c62bc6630 100644 --- a/travis.pl +++ b/travis.pl @@ -157,8 +157,8 @@ sub send_back_comment{ } print "[send_back_comment] method = $post_method to $post_url\n"; - `curl -v -H "Authorization: token bf43c85ee93d2fc18bd2c8446aa997c54fc2095b" -X $post_method -d '{"body":"$message"}' $post_url`; - #`curl -v -H "Authorization: token $ENV{'xcatbottoken'}" -X $post_method -d '{"body":"$message"}' $post_url`; + #`curl -v -H "Authorization: token bf43c85ee93d2fc18bd2c8446aa997c54fc2095b" -X $post_method -d '{"body":"$message"}' $post_url`; + `curl -u "$ENV{'xcatbotuser'}:$ENV{'xcatbotpw'}" -X $post_method -d '{"body":"$message"}' $post_url`; } #-------------------------------------------------------- @@ -439,6 +439,8 @@ my @travis_env_attr = ("TRAVIS_REPO_SLUG", "GITHUB_TOKEN", "USERNAME", "PASSWORD", + "xcatbotuser", + "xcatbotpw", "PWD"); foreach (@travis_env_attr){ print "$_ = $ENV{$_}\n"; From 37965e1a7cba403727661dab0a433e5555661f06 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Wed, 5 Jul 2017 03:16:16 -0400 Subject: [PATCH 09/14] build test --- travis.pl | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/travis.pl b/travis.pl index c62bc6630..bfef13842 100644 --- a/travis.pl +++ b/travis.pl @@ -157,7 +157,6 @@ sub send_back_comment{ } print "[send_back_comment] method = $post_method to $post_url\n"; - #`curl -v -H "Authorization: token bf43c85ee93d2fc18bd2c8446aa997c54fc2095b" -X $post_method -d '{"body":"$message"}' $post_url`; `curl -u "$ENV{'xcatbotuser'}:$ENV{'xcatbotpw'}" -X $post_method -d '{"body":"$message"}' $post_url`; } @@ -172,7 +171,7 @@ sub build_xcat_core{ my @output = runcmd("$cmd"); if($::RUNCMD_RC){ print "[build_xcat_core] $cmd ....[Failed]\n"; - send_back_comment("> **BUILD ERROR** : $cmd .... failed. Please get detaied information in ``Merge pull request`` box"); + send_back_comment("> **BUILD ERROR** : $cmd .... failed. Please click ``Details`` label in ``Merge pull request`` box for detailed information"); return 1; } @@ -186,7 +185,7 @@ sub build_xcat_core{ print "[build_xcat_core] $cmd ....[Failed]\n"; print ">>>>>Dumper the output of '$cmd'\n"; print Dumper \@output; - $check_result_str .= "> **BUILD ERROR**, Please get detaied information in ``Merge pull request`` box"; + $check_result_str .= "> **BUILD ERROR**, Please click ``Details`` label in ``Merge pull request`` box for detailed information"; send_back_comment("$check_result_str"); return 1; }else{ @@ -195,6 +194,11 @@ sub build_xcat_core{ send_back_comment("$check_result_str"); } +my $buildpath ="/home/travis/build/xcat-core/"; +my @buildfils = (); +get_files_recursive("$buildpath", \@buildfils); +print "\n-----------Dumper build files-----------\n"; +print Dumper \@buildfils; return 0; } @@ -219,7 +223,7 @@ sub install_xcat{ print RED "[install_xcat] $cmd. ...[Failed]\n"; print "[install_xcat] error message:\n"; print Dumper \@output; - $check_result_str .= "> **INSTALL XCAT ERROR** : Please get detaied information in ``Merge pull request`` box "; + $check_result_str .= "> **INSTALL XCAT ERROR** : Please click ``Details`` label in ``Merge pull request`` box for detailed information "; send_back_comment("$check_result_str"); return 1; } @@ -235,7 +239,7 @@ sub install_xcat{ print "[install_xcat] $cmd ....[Failed]\n"; print ">>>>>Dumper the output of '$cmd'\n"; print Dumper \@output; - $check_result_str .= "> **INSTALL XCAT ERROR** : Please get detaied information in ``Merge pull request`` box"; + $check_result_str .= "> **INSTALL XCAT ERROR** : Please click ``Details`` label in ``Merge pull request`` box for detailed information"; send_back_comment("$check_result_str"); return 1; }else{ @@ -263,7 +267,7 @@ sub install_xcat{ } } if($ret){ - $check_result_str .= "> **INSTALL XCAT ERROR** : Please get detaied information in ``Merge pull request`` box"; + $check_result_str .= "> **INSTALL XCAT ERROR** : Please click ``Details`` label in ``Merge pull request`` box for detailed information"; send_back_comment("$check_result_str"); return 1; } @@ -316,7 +320,7 @@ sub check_syntax{ print "[check_syntax] syntax checking ....[Failed]\n"; print "[check_syntax] Dumper error message:\n"; print Dumper @syntax_err; - $check_result_str .= "> **CODE SYNTAX ERROR** : Please get detaied information in ``Merge pull request`` box"; + $check_result_str .= "> **CODE SYNTAX ERROR** : Please click ``Details`` label in ``Merge pull request`` box for detailed information"; send_back_comment("$check_result_str"); }else{ print "[check_syntax] syntax checking ....[Pass]\n"; @@ -402,7 +406,7 @@ sub run_fast_regression_test{ if($failnum){ my $log_str = join (",", @failcase ); - $check_result_str .= "> **FAST REGRESSION TEST Failed**: Totalcase $casenum Pass $passnum failed $failnum FailedCases: $log_str. Please get detaied information in ``Merge pull request`` box"; + $check_result_str .= "> **FAST REGRESSION TEST Failed**: Totalcase $casenum Pass $passnum failed $failnum FailedCases: $log_str. Please click ``Details`` label in ``Merge pull request`` box for detailed information"; send_back_comment("$check_result_str"); return 1; }else{ From 51ec3df5c0289797cbf0d5480f477fbada9f01ed Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Wed, 5 Jul 2017 03:31:14 -0400 Subject: [PATCH 10/14] build test --- travis.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/travis.pl b/travis.pl index bfef13842..659c29857 100644 --- a/travis.pl +++ b/travis.pl @@ -177,8 +177,8 @@ sub build_xcat_core{ $cmd = "sudo ./build-ubunturepo -c UP=0 BUILDALL=1"; @output = runcmd("$cmd"); - #print ">>>>>Dumper the output of '$cmd'\n"; - #print Dumper \@output; + print ">>>>>Dumper the output of '$cmd'\n"; + print Dumper \@output; if($::RUNCMD_RC){ my $lastline = $output[-1]; $lastline =~ s/[\r\n\t\\"']*//g; From 8de802ba100522f372b8a2dd178a7c0a9d1940fd Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Wed, 5 Jul 2017 03:55:15 -0400 Subject: [PATCH 11/14] test build --- travis.pl | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/travis.pl b/travis.pl index 659c29857..70a51d7ac 100644 --- a/travis.pl +++ b/travis.pl @@ -167,12 +167,17 @@ sub send_back_comment{ # Retrun code: #-------------------------------------------------------- sub build_xcat_core{ - my $cmd = "gpg --list-keys"; - my @output = runcmd("$cmd"); - if($::RUNCMD_RC){ - print "[build_xcat_core] $cmd ....[Failed]\n"; - send_back_comment("> **BUILD ERROR** : $cmd .... failed. Please click ``Details`` label in ``Merge pull request`` box for detailed information"); - return 1; + my @output; + my @cmds = ("gpg --list-keys", + "sed -i '/SignWith: yes/d' $ENV{'PWD'}/build-ubunturepo"); + foreach my $cmd (@cmds){ + print "[build_xcat_core] to run $cmd\n"; + @output = runcmd("$cmd"); + if($::RUNCMD_RC){ + print "[build_xcat_core] $cmd ....[Failed]\n"; + send_back_comment("> **BUILD ERROR** : $cmd failed. Please click ``Details`` label in ``Merge pull request`` box for detailed information"); + return 1; + } } $cmd = "sudo ./build-ubunturepo -c UP=0 BUILDALL=1"; From 496d7b407d823a669469005ff9d12957f6da1bd5 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Wed, 5 Jul 2017 04:07:28 -0400 Subject: [PATCH 12/14] build test --- .travis.yml | 4 ++-- travis.pl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1ab68ff82..a04874d6c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,8 +22,8 @@ script: - echo $GITHUB_TOKEN - git log --pretty=format:"%s %b" -2 -- perl travis.pl -#- if [ $TRAVIS_EVENT_TYPE == "pull_request" ]; then perl ./travis.pl; fi +#- perl travis.pl +- if [ $TRAVIS_EVENT_TYPE == "pull_request" ]; then perl ./travis.pl; fi diff --git a/travis.pl b/travis.pl index 70a51d7ac..4d78af1be 100644 --- a/travis.pl +++ b/travis.pl @@ -180,7 +180,7 @@ sub build_xcat_core{ } } - $cmd = "sudo ./build-ubunturepo -c UP=0 BUILDALL=1"; + my $cmd = "sudo ./build-ubunturepo -c UP=0 BUILDALL=1"; @output = runcmd("$cmd"); print ">>>>>Dumper the output of '$cmd'\n"; print Dumper \@output; From 89df8e877e5d5455e433a0b6d31e59800e9abc5d Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Wed, 5 Jul 2017 04:36:00 -0400 Subject: [PATCH 13/14] test regression --- travis.pl | 16 +++++++++------- xCAT-test/autotest/bundle/MN_basic.bundle | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/travis.pl b/travis.pl index 4d78af1be..c9b5453aa 100644 --- a/travis.pl +++ b/travis.pl @@ -188,8 +188,8 @@ sub build_xcat_core{ my $lastline = $output[-1]; $lastline =~ s/[\r\n\t\\"']*//g; print "[build_xcat_core] $cmd ....[Failed]\n"; - print ">>>>>Dumper the output of '$cmd'\n"; - print Dumper \@output; + #print ">>>>>Dumper the output of '$cmd'\n"; + #print Dumper \@output; $check_result_str .= "> **BUILD ERROR**, Please click ``Details`` label in ``Merge pull request`` box for detailed information"; send_back_comment("$check_result_str"); return 1; @@ -199,11 +199,12 @@ sub build_xcat_core{ send_back_comment("$check_result_str"); } -my $buildpath ="/home/travis/build/xcat-core/"; -my @buildfils = (); -get_files_recursive("$buildpath", \@buildfils); -print "\n-----------Dumper build files-----------\n"; -print Dumper \@buildfils; +# my $buildpath ="/home/travis/build/xcat-core/"; +# my @buildfils = (); +# get_files_recursive("$buildpath", \@buildfils); +# print "\n-----------Dumper build files-----------\n"; +# print Dumper \@buildfils; + return 0; } @@ -223,6 +224,7 @@ sub install_xcat{ "sudo apt-get -qq update"); my @output; foreach my $cmd (@cmds){ + print "[install_xcat] to run $cmd\n"; @output = runcmd("$cmd"); if($::RUNCMD_RC){ print RED "[install_xcat] $cmd. ...[Failed]\n"; diff --git a/xCAT-test/autotest/bundle/MN_basic.bundle b/xCAT-test/autotest/bundle/MN_basic.bundle index 3639e92dd..7a7a70c96 100644 --- a/xCAT-test/autotest/bundle/MN_basic.bundle +++ b/xCAT-test/autotest/bundle/MN_basic.bundle @@ -73,7 +73,7 @@ makedhcp_n_linux makedns_h #makedns_n #makedns_node -makehost_n_r +#makehost_n_r #makehosts_d makehosts_h makehosts_help From 15ca602dd69e17c6184e64b2b66b2215ac97fdd4 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Wed, 5 Jul 2017 04:58:06 -0400 Subject: [PATCH 14/14] test regression --- xCAT-test/autotest/bundle/MN_basic.bundle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/bundle/MN_basic.bundle b/xCAT-test/autotest/bundle/MN_basic.bundle index 7a7a70c96..1b5b74063 100644 --- a/xCAT-test/autotest/bundle/MN_basic.bundle +++ b/xCAT-test/autotest/bundle/MN_basic.bundle @@ -218,7 +218,7 @@ tabrestore_err tabrestore_h tabrestore_null tabrestore_table -xcatd_restart +#xcatd_restart xcatd_start xcatd_stop xcatsnap_b_d