Skip to content

Commit

Permalink
Add script to generate N basic SAM test data and associated metadata …
Browse files Browse the repository at this point in the history
…files.
  • Loading branch information
bjwhite-fnal committed May 4, 2022
1 parent f4af86c commit 034d532
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions sam/make_sam_test_data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

PREFIX=bjwhite_testfiles
FILETYPE=testfiles

# Generate a bunch of files of random data between 0-1Kb.
for n in {000..050}
do
rand_int=$(( RANDOM + 2048*10 ))
f_id=$(echo "$n")
file_name="${PREFIX}_${f_id}.bin"
# Create data file
dd if=/dev/urandom of=data/${file_name} bs=1 count=${rand_int} > /dev/null 2>&1
# Create matching metadata file
echo "{\"file_name\": \"${file_name}\",\"file_size\": \"${rand_int}\",\"file_type\": \"${FILETYPE}\", \"group\": \"sam_bjwhite\" }" > data/${file_name}.json
done


0 comments on commit 034d532

Please sign in to comment.