summaryrefslogtreecommitdiffstats
path: root/auth/sample/cass_data/scrub.sh
diff options
context:
space:
mode:
Diffstat (limited to 'auth/sample/cass_data/scrub.sh')
-rw-r--r--auth/sample/cass_data/scrub.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/auth/sample/cass_data/scrub.sh b/auth/sample/cass_data/scrub.sh
new file mode 100644
index 00000000..016b58a7
--- /dev/null
+++ b/auth/sample/cass_data/scrub.sh
@@ -0,0 +1,20 @@
+> user_role.dat
+for ID in $(grep -v "#" ../data/sample.identities.dat | awk -F\| '{print $1}' | grep -v "^$"); do
+ grep "$ID@" dats/user_role.dat >> user_role.dat
+done
+
+for D in ns ns_attrib perm role config; do
+ cp dats/$D.dat .
+done
+
+echo "Roles in TEST data not in sample.identities.dat (../data)"
+UR="$(mktemp)"
+DUR="$(mktemp)"
+
+cat user_role.dat | awk -F\| '{print $1}' | sort -u > $UR
+cat dats/user_role.dat | awk -F\| '{print $1}' | sort -u > $DUR
+
+echo "Removed IDs from user_roles"
+diff $UR $DUR | grep "^>" | sort -u
+
+rm "$UR" "$DUR"