Skip to content

Commit

Permalink
Change file names
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Scavo committed Nov 11, 2016
1 parent 6fb46b3 commit 6925d86
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
32 changes: 16 additions & 16 deletions bin/check_idp_error_urls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ display_help () {
blank in the log file (which is why it is always the last field on
any given output line).
${ERROR_URL_LOG_FILENAME}
${IDP_ERROR_URL_LOG_FILENAME}
A log of each probe. Each line records the result of the probe of
a single entity. A line in the log file has the following
Expand All @@ -179,7 +179,7 @@ display_help () {
previous output file. An entity that ends up in this output file
was determined by the script to have an errorURL in metadata.
${ENTITY_NAMES_FILENAME}
${IDP_NAMES_FILENAME}
The names associated with every entity referenced on the command
line. A line in the log file has the following tab-delimited fields:
Expand Down Expand Up @@ -221,8 +221,8 @@ md_tools.sh"
# output filenames
NO_IDP_ROLE_FILENAME="entities-no-idp-role.txt"
NO_ERROR_URL_FILENAME="idps-no-error-url.txt"
ERROR_URL_LOG_FILENAME="idp-error-url-log.txt"
ENTITY_NAMES_FILENAME="idp-names.txt"
IDP_ERROR_URL_LOG_FILENAME="idp-error-url-log.txt"
IDP_NAMES_FILENAME="idp-names.txt"
ERROR_LOG_FILENAME="error-log.txt"
COMPATIBILITY_SCRIPT_FILENAME="compatibility.sh"

Expand Down Expand Up @@ -439,16 +439,16 @@ init_out_files () {
# output files
NO_IDP_ROLE_FILE="$OUT_DIR/$NO_IDP_ROLE_FILENAME"
NO_ERROR_URL_FILE="$OUT_DIR/$NO_ERROR_URL_FILENAME"
ERROR_URL_LOG_FILE="$OUT_DIR/$ERROR_URL_LOG_FILENAME"
ENTITY_NAMES_FILE="$OUT_DIR/$ENTITY_NAMES_FILENAME"
IDP_ERROR_URL_LOG_FILE="$OUT_DIR/$IDP_ERROR_URL_LOG_FILENAME"
IDP_NAMES_FILE="$OUT_DIR/$IDP_NAMES_FILENAME"
ERROR_LOG_FILE="$OUT_DIR/$ERROR_LOG_FILENAME"
COMPATIBILITY_SCRIPT_FILE="$OUT_DIR/$COMPATIBILITY_SCRIPT_FILENAME"

# clean up from last time if necessary
/bin/rm -f "$NO_IDP_ROLE_FILE"
/bin/rm -f "$NO_ERROR_URL_FILE"
/bin/rm -f "$ERROR_URL_LOG_FILE"
/bin/rm -f "$ENTITY_NAMES_FILE"
/bin/rm -f "$IDP_ERROR_URL_LOG_FILE"
/bin/rm -f "$IDP_NAMES_FILE"
/bin/rm -f "$ERROR_LOG_FILE"

# output cross-script compatibility info
Expand All @@ -459,8 +459,8 @@ init_out_files () {
# output files
NO_IDP_ROLE_FILE=$NO_IDP_ROLE_FILE
NO_ERROR_URL_FILE=$NO_ERROR_URL_FILE
ERROR_URL_LOG_FILE=$ERROR_URL_LOG_FILE
ENTITY_NAMES_FILE=$ENTITY_NAMES_FILE
IDP_ERROR_URL_LOG_FILE=$IDP_ERROR_URL_LOG_FILE
IDP_NAMES_FILE=$IDP_NAMES_FILE
# temporary output directory
TMP_DIR="$TMP_DIR"
COMPATIBILITY_SCRIPT
Expand All @@ -473,7 +473,7 @@ print_entity_names_logfile () {
local responseCode=$2
local names=$3

printf "%s\t%s\t%s\n" "$statusCode" "$responseCode" "$names" >> "$ENTITY_NAMES_FILE"
printf "%s\t%s\t%s\n" "$statusCode" "$responseCode" "$names" >> "$IDP_NAMES_FILE"
}

print_no_idp_role_logfile () {
Expand All @@ -499,8 +499,8 @@ print_error_url_logfile () {

local logfile=$1

printf "%s %s %s " "$status_code" "$output" "$errorURL" >> "$ERROR_URL_LOG_FILE"
printf "%s %s\n" "$entityID" "$registrarID" >> "$ERROR_URL_LOG_FILE"
printf "%s %s %s " "$status_code" "$output" "$errorURL" >> "$IDP_ERROR_URL_LOG_FILE"
printf "%s %s\n" "$entityID" "$registrarID" >> "$IDP_ERROR_URL_LOG_FILE"
}

#####################################################################
Expand Down Expand Up @@ -563,7 +563,7 @@ $verbose_mode && printf "$script_name using curl opts: %s\n" "$curl_opts"
echo "ERROR: $script_name: unable to extract IdP names for entityID: $entityID" >&2
continue
fi
echo "$names" >> "$ENTITY_NAMES_FILE"
echo "$names" >> "$IDP_NAMES_FILE"

# extract the errorURL from the entity descriptor
errorURL=$( echo "$entityDescriptor" \
Expand All @@ -574,7 +574,7 @@ $verbose_mode && printf "$script_name using curl opts: %s\n" "$curl_opts"
# if there is no errorURL, short-circuit the while-loop
if [ -z "$errorURL" ]; then
print_no_error_url_logfile "$entityID" "$registrarID"
echo "INFO: $script_name: entity has no errorURL: $entityID"
echo "INFO: $script_name: IdP has no errorURL: $entityID"
continue
fi

Expand All @@ -591,7 +591,7 @@ $verbose_mode && printf "$script_name using curl opts: %s\n" "$curl_opts"
#print_entity_names_logfile "$status_code" "$response_code" "$names"

printf "%s %s %s\n" "$status_code" "$output" "$errorURL"
print_error_url_logfile "$ERROR_URL_LOG_FILE"
print_error_url_logfile "$IDP_ERROR_URL_LOG_FILE"
done

exit 0
20 changes: 10 additions & 10 deletions bin/list_local_idp_error_urls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ for source_filename in $COMMAND_PATHS_FILENAME $COMPATIBLE_MKTEMP_FILENAME $MD_T
source "$source_file" >&2
exit_status=$?
if [ $exit_status -ne 0 ]; then
echo "ERROR: ${script_name} failed to source script $source_file" >&2
echo "ERROR: $script_name failed to source script $source_file" >&2
exit $exit_status
fi
done
Expand Down Expand Up @@ -205,8 +205,8 @@ print_idp_summary () {

heading="Number of IdPs with a good errorURL"
value=0
if [ -f "$ERROR_URL_LOG_FILE" ]; then
value=$( /bin/cat $ERROR_URL_LOG_FILE \
if [ -f "$IDP_ERROR_URL_LOG_FILE" ]; then
value=$( /bin/cat $IDP_ERROR_URL_LOG_FILE \
| $_GREP " $registrarID\$" \
| $_GREP "^0 redirects:.;response:200" \
| /usr/bin/wc -l
Expand All @@ -218,8 +218,8 @@ print_idp_summary () {

heading="Number of IdPs with a bad errorURL"
value=0
if [ -f "$ERROR_URL_LOG_FILE" ]; then
value=$( /bin/cat $ERROR_URL_LOG_FILE \
if [ -f "$IDP_ERROR_URL_LOG_FILE" ]; then
value=$( /bin/cat $IDP_ERROR_URL_LOG_FILE \
| $_GREP " $registrarID\$" \
| $_GREP -v "^0 redirects:.;response:200" \
| /usr/bin/wc -l
Expand Down Expand Up @@ -270,7 +270,7 @@ print_idp_list () {
printf "[\n"

# print list of IdPs with an errorURL in metadata
entityIDs=$( /bin/cat "$ERROR_URL_LOG_FILE" \
entityIDs=$( /bin/cat "$IDP_ERROR_URL_LOG_FILE" \
| $_GREP " $registrarID\$" \
| $_CUT -f4 -d" "
)
Expand All @@ -284,12 +284,12 @@ print_idp_list () {
fi

# get the names for this IdP
names=$( /bin/cat "$ENTITY_NAMES_FILE" | $_GREP -m 1 "^$entityID\t" )
names=$( /bin/cat "$IDP_NAMES_FILE" | $_GREP -m 1 "^$entityID\t" )
displayName=$( echo "$names" | $_CUT -f2 )
orgName=$( echo "$names" | $_CUT -f3 )

# get the errorURL for this IdP
log=$( /bin/cat "$ERROR_URL_LOG_FILE" | $_GREP -F -m 1 " $entityID " )
log=$( /bin/cat "$IDP_ERROR_URL_LOG_FILE" | $_GREP -F -m 1 " $entityID " )
errorURL=$( echo "$log" | $_CUT -f3 -d" " )

# get the codes for this IdP
Expand All @@ -315,7 +315,7 @@ print_idp_list () {
fi

# get the names for this IdP
names=$( /bin/cat "$ENTITY_NAMES_FILE" | $_GREP -m 1 "^$entityID\t" )
names=$( /bin/cat "$IDP_NAMES_FILE" | $_GREP -m 1 "^$entityID\t" )
displayName=$( echo "$names" | $_CUT -f2 )
orgName=$( echo "$names" | $_CUT -f3 )

Expand All @@ -337,7 +337,7 @@ print_idp_list () {
#######################################################################

# output files
idp_summary_file="$out_dir/local-idp-error_url-summary.json"
idp_summary_file="$out_dir/local-idp-error-url-summary.json"
idp_list_file="$out_dir/local-idp-error-url-list.json"

# clean up
Expand Down

0 comments on commit 6925d86

Please sign in to comment.