use strict; use warnings; require "$ENV{ADE_VIEW_ROOT}/emdb/sysman/webapps/em/WEB-INF/perl/has/hasadm_o.pl"; $ENV{ORA_CRS_HOME}='/ade/ajdsouza_has/oracle'; $ENV{CSS_CLUSTERNAME}='ajdsouzahas'; $ENV{CRS_HOME}="$ENV{ORA_CRS_HOME}"; $ENV{CV_HOME}="$ENV{CRS_HOME}"; $ENV{CV_JDKHOME}="$ENV{CRS_HOME}/jdk15"; $ENV{OCR_ROOT}="$ENV{CRS_HOME}/has_work/data.ocr"; $ENV{OCR_LOC}="$ENV{CRS_HOME}/has_work/ocr.loc"; $ENV{OCR_DEVELOPER_ENV}='TRUE'; $ENV{ORA_ENVIRON_OPTS}='true'; my $libs = "$ENV{CRS_HOME}/lib:$ENV{CRS_HOME}/has/lib:$ENV{CRS_HOME}/opsm/lib"; $ENV{LD_LIBRARY_PATH}="$libs:$ENV{LD_LIBRARY_PATH}" if $ENV{LD_LIBRARY_PATH}; $ENV{LD_LIBRARY_PATH}="$libs" unless $ENV{LD_LIBRARY_PATH}; $ENV{PATH}="$ENV{CRS_HOME}/bin:$ENV{CRS_HOME}/has/bin:$ENV{PATH}" if $ENV{PATH}; $ENV{PATH}="$ENV{CRS_HOME}/bin:$ENV{CRS_HOME}/has/bin" unless $ENV{PATH}; # capture and store the env to be used for regressions my $envref; $envref = has::Common::hasGetEnv(); my $has_run_mode = $ENV{HAS_TEST_MODE} if $ENV{HAS_TEST_MODE}; for my $k ( keys %{$envref} ) { $ENV{$k}=$envref->{$k}; } # restore HAS_TEST_MODE back to regression if running in regression mode $ENV{HAS_TEST_MODE}='REGRESSION' if $has_run_mode and $has_run_mode =~ /regression/i; # Test function to test all calls sub hasadm_test { my $nodename = hasadm_main('hasadm_get_nodename'); print " ************************ nodename = $nodename\n"; print " ************************ hasadm_resources\n"; hasadm_main('hasadm_resources'); print " ************************ hasadm_server_groups\n"; hasadm_main('hasadm_server_groups'); print " ************************ hasadm_servers\n"; hasadm_main('hasadm_servers'); print " ************************ hasadm_resource_types\n"; hasadm_main('hasadm_resource_types'); print " ************************ hasadm_nodes\n"; hasadm_main('hasadm_nodes'); print " ************************ hasadm_crsnodes\n"; hasadm_main('hasadm_crsnodes'); print " ************************ hasadm_resourceinstances\n"; hasadm_main('hasadm_resourceinstances'); #print " ************************ hasadm_stop_nodes\n"; #hasadm_main('hasadm_stop_nodes'); #print " ************************ hasadm_start_nodes\n"; #hasadm_main('hasadm_start_nodes'); print " ************************ hasadm_check_nodes\n"; hasadm_main('hasadm_check_nodes'); print " ************************ hasadm_allnode_crsstatus\n"; hasadm_main('hasadm_allnode_crsstatus'); print " ************************ hasadm_get_file_content /tmp/sg\.txt \n"; hasadm_main('hasadm_get_file_content','/tmp/sg.txt'); print " ************************ hasadm_get_file_content /tmp/filedoesnotexist\.txt \n"; hasadm_main('hasadm_get_file_content','/tmp/filedoesnotexist.txt'); print " ************************ hasadm_internalresource_types\n"; hasadm_main('hasadm_internalresource_types'); print " ************************ hasadm_run_crs_command emcrsp em config nodename\n"; hasadm_main('hasadm_run_crs_command','emcrsp em config nodename'); } hasadm_test; exit 0;