-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_hs.sh
executable file
·1586 lines (1489 loc) · 89.7 KB
/
test_hs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/bash
if [ "$1" ] ; then
TDIR="$1" ; shift
else
TDIR=/mnt/hs/testshare
fi
mkdir -p $TDIR/dir1/dir2/dir3/dir4/dir5/dir6
for dn in $(find $TDIR -type d -print) ; do
echo hello > $dn/file
done
set -u
#set -e
set -x
# TODO LIST:
# Need to make -s/--string an alternative to -e not a modifier thereto
# Fix escaping of embedded quotes
# Need to add the <verb> <noun> aliases
# Need to have set objective default to --unbound and need --bound as set
function test_attributes {
# ATTRIBUTE RELATED
hs attribute add color -e blue --string $TDIR/file
hs attribute set color -e blue --string $TDIR/file
hs attribute get color $TDIR/file
hs attribute get --local color $TDIR/file
hs attribute get --inherited color $TDIR/file
hs attribute get --object color $TDIR/file
hs attribute has color $TDIR/file
hs attribute has --local color $TDIR/file
hs attribute has --inherited color $TDIR/file
hs attribute has --object color $TDIR/file
hs attribute set color -e blue --string $TDIR/file
# This next line is expected to fail
# hs attribute set color -e "the color is \"blue" --string $TDIR/file
hs attribute set color -e "the color is \'blue" --string $TDIR/file
hs attribute set color -e green --string $TDIR/file
hs attribute set color -e '#EMPTY' $TDIR/file
hs attribute set color -e 'OLD_VALUE&"blue"' $TDIR/file
hs attribute get color $TDIR/file
hs attribute set color -e 'OLD_VALUE&"blue"' $TDIR/file
hs attribute get color $TDIR/file
hs attribute list $TDIR/file
hs attribute list --local $TDIR/file
hs attribute list --inherited $TDIR/file
hs attribute list --object $TDIR/file
hs attribute delete color $TDIR/
hs attribute set color -e '#empty' $TDIR/
hs attribute get color $TDIR/file
# RECURSIVE ATTRIBUTE RELATED
hs attribute set --recursive selected -e TRUE $TDIR/dir1
hs attribute get selected $TDIR/dir1/file
hs attribute get --recursive selected $TDIR/dir1
hs attribute get --recursive --raw selected $TDIR/dir1
hs attribute get --recursive --compact selected $TDIR/dir1
hs attribute get --recursive --local selected $TDIR/dir1
hs attribute get --recursive --local --raw selected $TDIR/dir1
hs attribute get --recursive --local --compact selected $TDIR/dir1
hs attribute get --recursive --inherited selected $TDIR/dir1
hs attribute get --recursive --inherited --raw selected $TDIR/dir1
hs attribute get --recursive --inherited --compact selected $TDIR/dir1
hs attribute get --recursive --object selected $TDIR/dir1
hs attribute get --recursive --object --raw selected $TDIR/dir1
hs attribute get --recursive --object --compact selected $TDIR/dir1
hs attribute get --recursive --unbound selected $TDIR/dir1
hs attribute get --recursive --unbound --raw selected $TDIR/dir1
hs attribute get --recursive --unbound --compact selected $TDIR/dir1
hs attribute get --recursive --unbound --local selected $TDIR/dir1
hs attribute get --recursive --unbound --local --raw selected $TDIR/dir1
hs attribute get --recursive --unbound --local --compact selected $TDIR/dir1
hs attribute get --recursive --unbound --inherited selected $TDIR/dir1
hs attribute get --recursive --unbound --inherited --raw selected $TDIR/dir1
hs attribute get --recursive --unbound --inherited --compact selected $TDIR/dir1
hs attribute get --recursive --unbound --object selected $TDIR/dir1
hs attribute get --recursive --unbound --object --raw selected $TDIR/dir1
hs attribute get --recursive --unbound --object --compact selected $TDIR/dir1
hs attribute has --recursive --raw selected $TDIR/dir1
hs attribute has --recursive --compact selected $TDIR/dir1
hs attribute has --recursive --local selected $TDIR/dir1
hs attribute has --recursive --local --raw selected $TDIR/dir1
hs attribute has --recursive --local --compact selected $TDIR/dir1
hs attribute has --recursive --inherited selected $TDIR/dir1
hs attribute has --recursive --inherited --raw selected $TDIR/dir1
hs attribute has --recursive --inherited --compact selected $TDIR/dir1
hs attribute has --recursive --object selected $TDIR/dir1
hs attribute has --recursive --object --raw selected $TDIR/dir1
hs attribute has --recursive --object --compact selected $TDIR/dir1
hs attribute delete --recursive selected $TDIR/dir1
hs attribute delete --recursive --force selected $TDIR/dir1
hs attribute set --recursive selected -e '#empty' $TDIR/dir1
hs attribute get selected $TDIR/dir1/file
# NONFILES ATTRIBUTE RELATED
hs attribute set --nonfiles selected -e TRUE $TDIR/dir1
hs attribute get selected $TDIR/dir1/file
hs attribute get --nonfiles selected $TDIR/dir1
hs attribute get --nonfiles --raw selected $TDIR/dir1
hs attribute get --nonfiles --compact selected $TDIR/dir1
hs attribute get --nonfiles --local selected $TDIR/dir1
hs attribute get --nonfiles --local --raw selected $TDIR/dir1
hs attribute get --nonfiles --local --compact selected $TDIR/dir1
hs attribute get --nonfiles --inherited selected $TDIR/dir1
hs attribute get --nonfiles --inherited --raw selected $TDIR/dir1
hs attribute get --nonfiles --inherited --compact selected $TDIR/dir1
hs attribute get --nonfiles --object selected $TDIR/dir1
hs attribute get --nonfiles --object --raw selected $TDIR/dir1
hs attribute get --nonfiles --object --compact selected $TDIR/dir1
hs attribute get --nonfiles --unbound selected $TDIR/dir1
hs attribute get --nonfiles --unbound --raw selected $TDIR/dir1
hs attribute get --nonfiles --unbound --compact selected $TDIR/dir1
hs attribute get --nonfiles --unbound --local selected $TDIR/dir1
hs attribute get --nonfiles --unbound --local --raw selected $TDIR/dir1
hs attribute get --nonfiles --unbound --local --compact selected $TDIR/dir1
hs attribute get --nonfiles --unbound --inherited selected $TDIR/dir1
hs attribute get --nonfiles --unbound --inherited --raw selected $TDIR/dir1
hs attribute get --nonfiles --unbound --inherited --compact selected $TDIR/dir1
hs attribute get --nonfiles --unbound --object selected $TDIR/dir1
hs attribute get --nonfiles --unbound --object --raw selected $TDIR/dir1
hs attribute get --nonfiles --unbound --object --compact selected $TDIR/dir1
hs attribute has --nonfiles --raw selected $TDIR/dir1
hs attribute has --nonfiles --compact selected $TDIR/dir1
hs attribute has --nonfiles --local selected $TDIR/dir1
hs attribute has --nonfiles --local --raw selected $TDIR/dir1
hs attribute has --nonfiles --local --compact selected $TDIR/dir1
hs attribute has --nonfiles --inherited selected $TDIR/dir1
hs attribute has --nonfiles --inherited --raw selected $TDIR/dir1
hs attribute has --nonfiles --inherited --compact selected $TDIR/dir1
hs attribute has --nonfiles --object selected $TDIR/dir1
hs attribute has --nonfiles --object --raw selected $TDIR/dir1
hs attribute has --nonfiles --object --compact selected $TDIR/dir1
hs attribute delete --nonfiles selected $TDIR/dir1
hs attribute delete --nonfiles --force selected $TDIR/dir1
hs attribute set --nonfiles selected -e '#empty' $TDIR/dir1
hs attribute get selected $TDIR/dir1/file
# CONTINUOUSLY EVALUATED FORMULA ATTRIBUTES
hs attribute set selected -e 'EXPRESSION(SIZE>5bytes)' $TDIR/file
hs attribute get selected $TDIR/file
hs attribute set --unbound selected -e 'SIZE>5bytes' $TDIR/file
hs attribute get --unbound selected $TDIR/file # cat $TDIR/file?.eval GET_ATTRIBUTE_UNBOUND("selected")
hs attribute get selected $TDIR/file
hs attribute get --raw selected $TDIR/file
hs attribute get --compact selected $TDIR/file
# ACCESSING ATTRIBUTES FROM WITHIN SCRIPT
hs eval -e 'get_attribute("color")' $TDIR/file
hs eval -e 'get_attribute_local("color")' $TDIR/file
hs eval -e 'get_attribute_inherited("color")' $TDIR/file
hs eval -e 'get_attribute_unbound("color")' $TDIR/file
hs eval -e 'get_attribute_local_unbound("color")' $TDIR/file
hs eval -e 'get_attribute_inherited_unbound("color")' $TDIR/file
hs eval -e 'attributes.color' $TDIR/file
hs eval -e 'attributes.color=="blue"' $TDIR/file
hs eval -e 'list_attributes' $TDIR/file
hs eval -e 'list_attributes_local' $TDIR/file
hs eval -e 'list_attributes_inherited' $TDIR/file
# TEST WORM ATTRIBUTE
hs attribute set worm_expire_date -e '#empty' $TDIR/file
hs attribute get worm_expire_date $TDIR/file
hs attribute set worm_expire_date -e "now+1year" $TDIR/file
hs attribute get worm_expire_date $TDIR/file
hs attribute set worm_expire_date -e "now+2years" $TDIR/file
hs attribute get worm_expire_date $TDIR/file
hs attribute set worm_expire_date -e "now+1month" $TDIR/file
hs attribute get worm_expire_date $TDIR/file
}
function test_attributes_json {
# ATTRIBUTE RELATED
hs --json attribute add color -e blue --string $TDIR/file
hs --json attribute set color -e blue --string $TDIR/file
hs --json attribute get color $TDIR/file
hs --json attribute get --local color $TDIR/file
hs --json attribute get --inherited color $TDIR/file
hs --json attribute get --object color $TDIR/file
hs --json attribute has color $TDIR/file
hs --json attribute has --local color $TDIR/file
hs --json attribute has --inherited color $TDIR/file
hs --json attribute has --object color $TDIR/file
hs --json attribute set color -e blue --string $TDIR/file
# This next line is expected to fail
# hs --json attribute set color -e "the color is \"blue" --string $TDIR/file
hs --json attribute set color -e "the color is \'blue" --string $TDIR/file
hs --json attribute set color -e green --string $TDIR/file
hs --json attribute set color -e '#EMPTY' $TDIR/file
hs --json attribute set color -e 'OLD_VALUE&"blue"' $TDIR/file
hs --json attribute get color $TDIR/file
hs --json attribute set color -e 'OLD_VALUE&"blue"' $TDIR/file
hs --json attribute get color $TDIR/file
hs --json attribute list $TDIR/file
hs --json attribute list --local $TDIR/file
hs --json attribute list --inherited $TDIR/file
hs --json attribute list --object $TDIR/file
hs --json attribute delete color $TDIR/
hs --json attribute set color -e '#empty' $TDIR/
hs --json attribute get color $TDIR/file
# RECURSIVE ATTRIBUTE RELATED
hs --json attribute set --recursive selected -e TRUE $TDIR/dir1
hs --json attribute get selected $TDIR/dir1/file
hs --json attribute get --recursive selected $TDIR/dir1
hs --json attribute get --recursive --raw selected $TDIR/dir1
hs --json attribute get --recursive --compact selected $TDIR/dir1
hs --json attribute get --recursive --local selected $TDIR/dir1
hs --json attribute get --recursive --local --raw selected $TDIR/dir1
hs --json attribute get --recursive --local --compact selected $TDIR/dir1
hs --json attribute get --recursive --inherited selected $TDIR/dir1
hs --json attribute get --recursive --inherited --raw selected $TDIR/dir1
hs --json attribute get --recursive --inherited --compact selected $TDIR/dir1
hs --json attribute get --recursive --object selected $TDIR/dir1
hs --json attribute get --recursive --object --raw selected $TDIR/dir1
hs --json attribute get --recursive --object --compact selected $TDIR/dir1
hs --json attribute get --recursive --unbound selected $TDIR/dir1
hs --json attribute get --recursive --unbound --raw selected $TDIR/dir1
hs --json attribute get --recursive --unbound --compact selected $TDIR/dir1
hs --json attribute get --recursive --unbound --local selected $TDIR/dir1
hs --json attribute get --recursive --unbound --local --raw selected $TDIR/dir1
hs --json attribute get --recursive --unbound --local --compact selected $TDIR/dir1
hs --json attribute get --recursive --unbound --inherited selected $TDIR/dir1
hs --json attribute get --recursive --unbound --inherited --raw selected $TDIR/dir1
hs --json attribute get --recursive --unbound --inherited --compact selected $TDIR/dir1
hs --json attribute get --recursive --unbound --object selected $TDIR/dir1
hs --json attribute get --recursive --unbound --object --raw selected $TDIR/dir1
hs --json attribute get --recursive --unbound --object --compact selected $TDIR/dir1
hs --json attribute has --recursive --raw selected $TDIR/dir1
hs --json attribute has --recursive --compact selected $TDIR/dir1
hs --json attribute has --recursive --local selected $TDIR/dir1
hs --json attribute has --recursive --local --raw selected $TDIR/dir1
hs --json attribute has --recursive --local --compact selected $TDIR/dir1
hs --json attribute has --recursive --inherited selected $TDIR/dir1
hs --json attribute has --recursive --inherited --raw selected $TDIR/dir1
hs --json attribute has --recursive --inherited --compact selected $TDIR/dir1
hs --json attribute has --recursive --object selected $TDIR/dir1
hs --json attribute has --recursive --object --raw selected $TDIR/dir1
hs --json attribute has --recursive --object --compact selected $TDIR/dir1
hs --json attribute delete --recursive selected $TDIR/dir1
hs --json attribute delete --recursive --force selected $TDIR/dir1
hs --json attribute set --recursive selected -e '#empty' $TDIR/dir1
hs --json attribute get selected $TDIR/dir1/file
# NONFILES ATTRIBUTE RELATED
hs --json attribute set --nonfiles selected -e TRUE $TDIR/dir1
hs --json attribute get selected $TDIR/dir1/file
hs --json attribute get --nonfiles selected $TDIR/dir1
hs --json attribute get --nonfiles --raw selected $TDIR/dir1
hs --json attribute get --nonfiles --compact selected $TDIR/dir1
hs --json attribute get --nonfiles --local selected $TDIR/dir1
hs --json attribute get --nonfiles --local --raw selected $TDIR/dir1
hs --json attribute get --nonfiles --local --compact selected $TDIR/dir1
hs --json attribute get --nonfiles --inherited selected $TDIR/dir1
hs --json attribute get --nonfiles --inherited --raw selected $TDIR/dir1
hs --json attribute get --nonfiles --inherited --compact selected $TDIR/dir1
hs --json attribute get --nonfiles --object selected $TDIR/dir1
hs --json attribute get --nonfiles --object --raw selected $TDIR/dir1
hs --json attribute get --nonfiles --object --compact selected $TDIR/dir1
hs --json attribute get --nonfiles --unbound selected $TDIR/dir1
hs --json attribute get --nonfiles --unbound --raw selected $TDIR/dir1
hs --json attribute get --nonfiles --unbound --compact selected $TDIR/dir1
hs --json attribute get --nonfiles --unbound --local selected $TDIR/dir1
hs --json attribute get --nonfiles --unbound --local --raw selected $TDIR/dir1
hs --json attribute get --nonfiles --unbound --local --compact selected $TDIR/dir1
hs --json attribute get --nonfiles --unbound --inherited selected $TDIR/dir1
hs --json attribute get --nonfiles --unbound --inherited --raw selected $TDIR/dir1
hs --json attribute get --nonfiles --unbound --inherited --compact selected $TDIR/dir1
hs --json attribute get --nonfiles --unbound --object selected $TDIR/dir1
hs --json attribute get --nonfiles --unbound --object --raw selected $TDIR/dir1
hs --json attribute get --nonfiles --unbound --object --compact selected $TDIR/dir1
hs --json attribute has --nonfiles --raw selected $TDIR/dir1
hs --json attribute has --nonfiles --compact selected $TDIR/dir1
hs --json attribute has --nonfiles --local selected $TDIR/dir1
hs --json attribute has --nonfiles --local --raw selected $TDIR/dir1
hs --json attribute has --nonfiles --local --compact selected $TDIR/dir1
hs --json attribute has --nonfiles --inherited selected $TDIR/dir1
hs --json attribute has --nonfiles --inherited --raw selected $TDIR/dir1
hs --json attribute has --nonfiles --inherited --compact selected $TDIR/dir1
hs --json attribute has --nonfiles --object selected $TDIR/dir1
hs --json attribute has --nonfiles --object --raw selected $TDIR/dir1
hs --json attribute has --nonfiles --object --compact selected $TDIR/dir1
hs --json attribute delete --nonfiles selected $TDIR/dir1
hs --json attribute delete --nonfiles --force selected $TDIR/dir1
hs --json attribute set --nonfiles selected -e '#empty' $TDIR/dir1
hs --json attribute get selected $TDIR/dir1/file
# CONTINUOUSLY EVALUATED FORMULA ATTRIBUTES
hs --json attribute set selected -e 'EXPRESSION(SIZE>5bytes)' $TDIR/file
hs --json attribute get selected $TDIR/file
hs --json attribute set --unbound selected -e 'SIZE>5bytes' $TDIR/file
hs --json attribute get --unbound selected $TDIR/file # cat $TDIR/file?.eval GET_ATTRIBUTE_UNBOUND("selected")
hs --json attribute get selected $TDIR/file
hs --json attribute get --raw selected $TDIR/file
hs --json attribute get --compact selected $TDIR/file
# ACCESSING ATTRIBUTES FROM WITHIN SCRIPT
hs --json eval -e 'get_attribute("color")' $TDIR/file
hs --json eval -e 'get_attribute_local("color")' $TDIR/file
hs --json eval -e 'get_attribute_inherited("color")' $TDIR/file
hs --json eval -e 'get_attribute_unbound("color")' $TDIR/file
hs --json eval -e 'get_attribute_local_unbound("color")' $TDIR/file
hs --json eval -e 'get_attribute_inherited_unbound("color")' $TDIR/file
hs --json eval -e 'attributes.color' $TDIR/file
hs --json eval -e 'attributes.color=="blue"' $TDIR/file
hs --json eval -e 'list_attributes' $TDIR/file
hs --json eval -e 'list_attributes_local' $TDIR/file
hs --json eval -e 'list_attributes_inherited' $TDIR/file
}
function test_tags {
# TAG RELATED
hs tag add mytag -e 1gbyte $TDIR/file # Need to implement tag add
hs tag get mytag $TDIR/file
hs tag set mytag -e 1gbyte $TDIR/file
hs tag get --local mytag $TDIR/file
hs tag get --inherited mytag $TDIR/file
hs tag get --object mytag $TDIR/file
hs tag has mytag $TDIR/file
hs tag has --local mytag $TDIR/file
hs tag has --inherited mytag $TDIR/file
hs tag has --object mytag $TDIR/file
hs tag list $TDIR/file
hs tag list --local $TDIR/file
hs tag list --inherited $TDIR/file
hs tag list --object $TDIR/file
# This next line is expected to fail
# hs tag delete mytag $TDIR/file
hs tag delete --force mytag $TDIR/file
hs tag get mytag $TDIR/file
hs tag set mytag -e "'some string'" --string $TDIR/file
hs tag get mytag $TDIR/file
hs tag set mytag -e '#EMPTY' $TDIR/file
hs tag get mytag $TDIR/file
hs tag set mytag -e 'OLD_VALUE+1' $TDIR/file
hs tag get mytag $TDIR/file
hs tag set mytag -e 'OLD_VALUE+1' $TDIR/file
hs tag get mytag $TDIR/file
# RECURSIVE TAG RELATED
hs tag add --recursive mytag -e 'EXPRESSION(NOW)' $TDIR/dir1
hs tag set --recursive mytag -e 'EXPRESSION(NOW)' $TDIR/dir1
hs tag get mytag $TDIR/dir1/file
hs tag get --recursive mytag $TDIR/dir1/file
hs tag get --recursive --raw mytag $TDIR/dir1/file
hs tag get --recursive --compact mytag $TDIR/dir1/file
hs tag get --recursive --local mytag $TDIR/dir1/file
hs tag get --recursive --local --raw mytag $TDIR/dir1/file
hs tag get --recursive --local --compact mytag $TDIR/dir1/file
hs tag get --recursive --inherited mytag $TDIR/dir1/file
hs tag get --recursive --inherited --raw mytag $TDIR/dir1/file
hs tag get --recursive --inherited --compact mytag $TDIR/dir1/file
hs tag get --recursive --object mytag $TDIR/dir1/file
hs tag get --recursive --object --raw mytag $TDIR/dir1/file
hs tag get --recursive --object --compact mytag $TDIR/dir1/file
hs tag get --recursive --unbound mytag $TDIR/dir1/file
hs tag get --recursive --unbound --raw mytag $TDIR/dir1/file
hs tag get --recursive --unbound --compact mytag $TDIR/dir1/file
hs tag get --recursive --unbound --local mytag $TDIR/dir1/file
hs tag get --recursive --unbound --local --raw mytag $TDIR/dir1/file
hs tag get --recursive --unbound --local --compact mytag $TDIR/dir1/file
hs tag get --recursive --unbound --inherited mytag $TDIR/dir1/file
hs tag get --recursive --unbound --inherited --raw mytag $TDIR/dir1/file
hs tag get --recursive --unbound --inherited --compact mytag $TDIR/dir1/file
hs tag get --recursive --unbound --object mytag $TDIR/dir1/file
hs tag get --recursive --unbound --object --raw mytag $TDIR/dir1/file
hs tag get --recursive --unbound --object --compact mytag $TDIR/dir1/file
hs tag has --recursive mytag $TDIR/dir1/file
hs tag has --recursive --raw mytag $TDIR/dir1/file
hs tag has --recursive --compact mytag $TDIR/dir1/file
hs tag has --recursive --local mytag $TDIR/dir1/file
hs tag has --recursive --local --raw mytag $TDIR/dir1/file
hs tag has --recursive --local --compact mytag $TDIR/dir1/file
hs tag has --recursive --inherited mytag $TDIR/dir1/file
hs tag has --recursive --inherited --raw mytag $TDIR/dir1/file
hs tag has --recursive --inherited --compact mytag $TDIR/dir1/file
hs tag has --recursive --object mytag $TDIR/dir1/file
hs tag has --recursive --object --raw mytag $TDIR/dir1/file
hs tag has --recursive --object --compact mytag $TDIR/dir1/file
hs tag delete --recursive mytag $TDIR/dir1
hs tag delete --recursive --force mytag $TDIR/dir1
hs tag get mytag $TDIR/dir1/file
# NONFILES TAG RELATED
hs tag add --nonfiles mytag -e 'EXPRESSION(NOW)' $TDIR/dir1
hs tag set --nonfiles mytag -e 'EXPRESSION(NOW)' $TDIR/dir1
hs tag get mytag $TDIR/dir1/file
hs tag get --nonfiles mytag $TDIR/dir1/file
hs tag get --nonfiles --raw mytag $TDIR/dir1/file
hs tag get --nonfiles --compact mytag $TDIR/dir1/file
hs tag get --nonfiles --local mytag $TDIR/dir1/file
hs tag get --nonfiles --local --raw mytag $TDIR/dir1/file
hs tag get --nonfiles --local --compact mytag $TDIR/dir1/file
hs tag get --nonfiles --inherited mytag $TDIR/dir1/file
hs tag get --nonfiles --inherited --raw mytag $TDIR/dir1/file
hs tag get --nonfiles --inherited --compact mytag $TDIR/dir1/file
hs tag get --nonfiles --object mytag $TDIR/dir1/file
hs tag get --nonfiles --object --raw mytag $TDIR/dir1/file
hs tag get --nonfiles --object --compact mytag $TDIR/dir1/file
hs tag get --nonfiles --unbound mytag $TDIR/dir1/file
hs tag get --nonfiles --unbound --raw mytag $TDIR/dir1/file
hs tag get --nonfiles --unbound --compact mytag $TDIR/dir1/file
hs tag get --nonfiles --unbound --local mytag $TDIR/dir1/file
hs tag get --nonfiles --unbound --local --raw mytag $TDIR/dir1/file
hs tag get --nonfiles --unbound --local --compact mytag $TDIR/dir1/file
hs tag get --nonfiles --unbound --inherited mytag $TDIR/dir1/file
hs tag get --nonfiles --unbound --inherited --raw mytag $TDIR/dir1/file
hs tag get --nonfiles --unbound --inherited --compact mytag $TDIR/dir1/file
hs tag get --nonfiles --unbound --object mytag $TDIR/dir1/file
hs tag get --nonfiles --unbound --object --raw mytag $TDIR/dir1/file
hs tag get --nonfiles --unbound --object --compact mytag $TDIR/dir1/file
hs tag has --nonfiles mytag $TDIR/dir1/file
hs tag has --nonfiles --raw mytag $TDIR/dir1/file
hs tag has --nonfiles --compact mytag $TDIR/dir1/file
hs tag has --nonfiles --local mytag $TDIR/dir1/file
hs tag has --nonfiles --local --raw mytag $TDIR/dir1/file
hs tag has --nonfiles --local --compact mytag $TDIR/dir1/file
hs tag has --nonfiles --inherited mytag $TDIR/dir1/file
hs tag has --nonfiles --inherited --raw mytag $TDIR/dir1/file
hs tag has --nonfiles --inherited --compact mytag $TDIR/dir1/file
hs tag has --nonfiles --object mytag $TDIR/dir1/file
hs tag has --nonfiles --object --raw mytag $TDIR/dir1/file
hs tag has --nonfiles --object --compact mytag $TDIR/dir1/file
hs tag delete --nonfiles mytag $TDIR/dir1
hs tag delete --nonfiles --force mytag $TDIR/dir1
hs tag get mytag $TDIR/dir1/file
# CONTINUOUSLY EVALUATED FORMULA TAGS
hs tag set mytag -e 'EXPRESSION(NOW)' $TDIR/dir1
hs tag get mytag $TDIR/dir1
hs tag set --unbound mytag -e 'NOW' $TDIR/dir1
hs tag get --unbound mytag $TDIR/dir1 # cat $TDIR/file?.eval GET_TAG_UNBOUND("mytag")
hs tag get mytag $TDIR/dir1
sleep 2
hs tag get mytag $TDIR/dir1
hs tag get --raw mytag $TDIR/dir1
hs tag get --compact mytag $TDIR/dir1
hs tag delete mytag $TDIR/dir1
hs tag delete --force mytag $TDIR/dir1
# FROM WITHIN A SCRIPT
#hs eval 'set_tag("mytag", "1gbyte")' $TDIR/file # XXX this doesn't seem to take, should it?
hs tag set mytag -e 1gbyte $TDIR/file
# hs eval -e 'get_tag("mytag")==1gbyte' $TDIR/file
# THIS ONE IS EXPECTED TO RETURN AN ERROR hs eval -e 'get_tag("mytag")=="1gbyte"' $TDIR/file
hs eval -e 'get_tag("mytag")' $TDIR/file
hs tag set mytag -e 'EXPRESSION(NOW)' $TDIR/dir1
hs eval -e 'get_tag("mytag")' $TDIR/file
hs eval -e 'get_tag_local("mytag")' $TDIR/file
hs eval -e 'get_tag_inherited("mytag")' $TDIR/file
hs eval -e 'get_tag_unbound("mytag")' $TDIR/file
hs eval -e 'get_tag_local_unbound("mytag")' $TDIR/file
hs eval -e 'get_tag_inherited_unbound("mytag")' $TDIR/file
hs eval -e 'has_tag("mytag")' $TDIR/file
hs eval -e 'has_tag_local("mytag")' $TDIR/file
hs eval -e 'has_tag_inherited("mytag")' $TDIR/file
hs eval -e 'list_tags' $TDIR/file
hs eval -e 'list_tags_local' $TDIR/file
hs eval -e 'list_tags_inherited' $TDIR/file
hs eval -e 'attributes.#TAGS' $TDIR/file
}
function test_tags_json {
# TAG RELATED
hs --json tag add mytag -e 1gbyte $TDIR/file # Need to implement tag add
hs --json tag get mytag $TDIR/file
hs --json tag set mytag -e 1gbyte $TDIR/file
hs --json tag get --local mytag $TDIR/file
hs --json tag get --inherited mytag $TDIR/file
hs --json tag get --object mytag $TDIR/file
hs --json tag has mytag $TDIR/file
hs --json tag has --local mytag $TDIR/file
hs --json tag has --inherited mytag $TDIR/file
hs --json tag has --object mytag $TDIR/file
hs --json tag list $TDIR/file
hs --json tag list --local $TDIR/file
hs --json tag list --inherited $TDIR/file
hs --json tag list --object $TDIR/file
# This next line is expected to fail
# hs --json tag delete mytag $TDIR/file
hs --json tag delete --force mytag $TDIR/file
hs --json tag get mytag $TDIR/file
hs --json tag set mytag -e "'some string'" --string $TDIR/file
hs --json tag get mytag $TDIR/file
hs --json tag set mytag -e '#EMPTY' $TDIR/file
hs --json tag get mytag $TDIR/file
hs --json tag set mytag -e 'OLD_VALUE+1' $TDIR/file
hs --json tag get mytag $TDIR/file
hs --json tag set mytag -e 'OLD_VALUE+1' $TDIR/file
hs --json tag get mytag $TDIR/file
# RECURSIVE TAG RELATED
hs --json tag add --recursive mytag -e 'EXPRESSION(NOW)' $TDIR/dir1
hs --json tag set --recursive mytag -e 'EXPRESSION(NOW)' $TDIR/dir1
hs --json tag get mytag $TDIR/dir1/file
hs --json tag get --recursive mytag $TDIR/dir1/file
hs --json tag get --recursive --raw mytag $TDIR/dir1/file
hs --json tag get --recursive --compact mytag $TDIR/dir1/file
hs --json tag get --recursive --local mytag $TDIR/dir1/file
hs --json tag get --recursive --local --raw mytag $TDIR/dir1/file
hs --json tag get --recursive --local --compact mytag $TDIR/dir1/file
hs --json tag get --recursive --inherited mytag $TDIR/dir1/file
hs --json tag get --recursive --inherited --raw mytag $TDIR/dir1/file
hs --json tag get --recursive --inherited --compact mytag $TDIR/dir1/file
hs --json tag get --recursive --object mytag $TDIR/dir1/file
hs --json tag get --recursive --object --raw mytag $TDIR/dir1/file
hs --json tag get --recursive --object --compact mytag $TDIR/dir1/file
hs --json tag get --recursive --unbound mytag $TDIR/dir1/file
hs --json tag get --recursive --unbound --raw mytag $TDIR/dir1/file
hs --json tag get --recursive --unbound --compact mytag $TDIR/dir1/file
hs --json tag get --recursive --unbound --local mytag $TDIR/dir1/file
hs --json tag get --recursive --unbound --local --raw mytag $TDIR/dir1/file
hs --json tag get --recursive --unbound --local --compact mytag $TDIR/dir1/file
hs --json tag get --recursive --unbound --inherited mytag $TDIR/dir1/file
hs --json tag get --recursive --unbound --inherited --raw mytag $TDIR/dir1/file
hs --json tag get --recursive --unbound --inherited --compact mytag $TDIR/dir1/file
hs --json tag get --recursive --unbound --object mytag $TDIR/dir1/file
hs --json tag get --recursive --unbound --object --raw mytag $TDIR/dir1/file
hs --json tag get --recursive --unbound --object --compact mytag $TDIR/dir1/file
hs --json tag has --recursive mytag $TDIR/dir1/file
hs --json tag has --recursive --raw mytag $TDIR/dir1/file
hs --json tag has --recursive --compact mytag $TDIR/dir1/file
hs --json tag has --recursive --local mytag $TDIR/dir1/file
hs --json tag has --recursive --local --raw mytag $TDIR/dir1/file
hs --json tag has --recursive --local --compact mytag $TDIR/dir1/file
hs --json tag has --recursive --inherited mytag $TDIR/dir1/file
hs --json tag has --recursive --inherited --raw mytag $TDIR/dir1/file
hs --json tag has --recursive --inherited --compact mytag $TDIR/dir1/file
hs --json tag has --recursive --object mytag $TDIR/dir1/file
hs --json tag has --recursive --object --raw mytag $TDIR/dir1/file
hs --json tag has --recursive --object --compact mytag $TDIR/dir1/file
hs --json tag delete --recursive mytag $TDIR/dir1
hs --json tag delete --recursive --force mytag $TDIR/dir1
hs --json tag get mytag $TDIR/dir1/file
# NONFILES TAG RELATED
hs --json tag add --nonfiles mytag -e 'EXPRESSION(NOW)' $TDIR/dir1
hs --json tag set --nonfiles mytag -e 'EXPRESSION(NOW)' $TDIR/dir1
hs --json tag get mytag $TDIR/dir1/file
hs --json tag get --nonfiles mytag $TDIR/dir1/file
hs --json tag get --nonfiles --raw mytag $TDIR/dir1/file
hs --json tag get --nonfiles --compact mytag $TDIR/dir1/file
hs --json tag get --nonfiles --local mytag $TDIR/dir1/file
hs --json tag get --nonfiles --local --raw mytag $TDIR/dir1/file
hs --json tag get --nonfiles --local --compact mytag $TDIR/dir1/file
hs --json tag get --nonfiles --inherited mytag $TDIR/dir1/file
hs --json tag get --nonfiles --inherited --raw mytag $TDIR/dir1/file
hs --json tag get --nonfiles --inherited --compact mytag $TDIR/dir1/file
hs --json tag get --nonfiles --object mytag $TDIR/dir1/file
hs --json tag get --nonfiles --object --raw mytag $TDIR/dir1/file
hs --json tag get --nonfiles --object --compact mytag $TDIR/dir1/file
hs --json tag get --nonfiles --unbound mytag $TDIR/dir1/file
hs --json tag get --nonfiles --unbound --raw mytag $TDIR/dir1/file
hs --json tag get --nonfiles --unbound --compact mytag $TDIR/dir1/file
hs --json tag get --nonfiles --unbound --local mytag $TDIR/dir1/file
hs --json tag get --nonfiles --unbound --local --raw mytag $TDIR/dir1/file
hs --json tag get --nonfiles --unbound --local --compact mytag $TDIR/dir1/file
hs --json tag get --nonfiles --unbound --inherited mytag $TDIR/dir1/file
hs --json tag get --nonfiles --unbound --inherited --raw mytag $TDIR/dir1/file
hs --json tag get --nonfiles --unbound --inherited --compact mytag $TDIR/dir1/file
hs --json tag get --nonfiles --unbound --object mytag $TDIR/dir1/file
hs --json tag get --nonfiles --unbound --object --raw mytag $TDIR/dir1/file
hs --json tag get --nonfiles --unbound --object --compact mytag $TDIR/dir1/file
hs --json tag has --nonfiles mytag $TDIR/dir1/file
hs --json tag has --nonfiles --raw mytag $TDIR/dir1/file
hs --json tag has --nonfiles --compact mytag $TDIR/dir1/file
hs --json tag has --nonfiles --local mytag $TDIR/dir1/file
hs --json tag has --nonfiles --local --raw mytag $TDIR/dir1/file
hs --json tag has --nonfiles --local --compact mytag $TDIR/dir1/file
hs --json tag has --nonfiles --inherited mytag $TDIR/dir1/file
hs --json tag has --nonfiles --inherited --raw mytag $TDIR/dir1/file
hs --json tag has --nonfiles --inherited --compact mytag $TDIR/dir1/file
hs --json tag has --nonfiles --object mytag $TDIR/dir1/file
hs --json tag has --nonfiles --object --raw mytag $TDIR/dir1/file
hs --json tag has --nonfiles --object --compact mytag $TDIR/dir1/file
hs --json tag delete --nonfiles mytag $TDIR/dir1
hs --json tag delete --nonfiles --force mytag $TDIR/dir1
hs --json tag get mytag $TDIR/dir1/file
# CONTINUOUSLY EVALUATED FORMULA TAGS
hs --json tag set mytag -e 'EXPRESSION(NOW)' $TDIR/dir1
hs --json tag get mytag $TDIR/dir1
hs --json tag set --unbound mytag -e 'NOW' $TDIR/dir1
hs --json tag get --unbound mytag $TDIR/dir1 # cat $TDIR/file?.eval GET_TAG_UNBOUND("mytag")
hs --json tag get mytag $TDIR/dir1
sleep 2
hs --json tag get mytag $TDIR/dir1
hs --json tag get --raw mytag $TDIR/dir1
hs --json tag get --compact mytag $TDIR/dir1
hs --json tag delete mytag $TDIR/dir1
hs --json tag delete --force mytag $TDIR/dir1
# FROM WITHIN A SCRIPT
#hs --json eval 'set_tag("mytag", "1gbyte")' $TDIR/file # XXX this doesn't seem to take, should it?
hs --json tag set mytag -e 1gbyte $TDIR/file
# hs --json eval -e 'get_tag("mytag")==1gbyte' $TDIR/file
# THIS ONE IS EXPECTED TO RETURN AN ERROR hs --json eval -e 'get_tag("mytag")=="1gbyte"' $TDIR/file
hs --json eval -e 'get_tag("mytag")' $TDIR/file
hs --json tag set mytag -e 'EXPRESSION(NOW)' $TDIR/dir1
hs --json eval -e 'get_tag("mytag")' $TDIR/file
hs --json eval -e 'get_tag_local("mytag")' $TDIR/file
hs --json eval -e 'get_tag_inherited("mytag")' $TDIR/file
hs --json eval -e 'get_tag_unbound("mytag")' $TDIR/file
hs --json eval -e 'get_tag_local_unbound("mytag")' $TDIR/file
hs --json eval -e 'get_tag_inherited_unbound("mytag")' $TDIR/file
hs --json eval -e 'has_tag("mytag")' $TDIR/file
hs --json eval -e 'has_tag_local("mytag")' $TDIR/file
hs --json eval -e 'has_tag_inherited("mytag")' $TDIR/file
hs --json eval -e 'list_tags' $TDIR/file
hs --json eval -e 'list_tags_local' $TDIR/file
hs --json eval -e 'list_tags_inherited' $TDIR/file
hs --json eval -e 'attributes.#TAGS' $TDIR/file
}
function test_rekognition_tags {
# TAG RELATED
hs rekognition_tag add mytag -e 1gbyte $TDIR/file # Need to implement tag add
hs rekognition_tag get mytag $TDIR/file
hs rekognition_tag set mytag -e "80%" $TDIR/file
hs rekognition_tag get --local mytag $TDIR/file
hs rekognition_tag get --inherited mytag $TDIR/file
hs rekognition_tag get --object mytag $TDIR/file
hs rekognition_tag has mytag $TDIR/file
hs rekognition_tag has --local mytag $TDIR/file
hs rekognition_tag has --inherited mytag $TDIR/file
hs rekognition_tag has --object mytag $TDIR/file
hs rekognition_tag list $TDIR/file
hs rekognition_tag list --local $TDIR/file
hs rekognition_tag list --inherited $TDIR/file
hs rekognition_tag list --object $TDIR/file
# This next line is expected to fail
# hs rekognition_tag delete mytag $TDIR/file
hs rekognition_tag delete --force mytag $TDIR/file
hs rekognition_tag get mytag $TDIR/file
hs rekognition_tag set mytag -e "'some string'" --string $TDIR/file
hs rekognition_tag get mytag $TDIR/file
hs rekognition_tag set mytag -e '#EMPTY' $TDIR/file
hs rekognition_tag get mytag $TDIR/file
hs rekognition_tag set mytag -e 'OLD_VALUE+1' $TDIR/file
hs rekognition_tag get mytag $TDIR/file
hs rekognition_tag set mytag -e 'OLD_VALUE+1' $TDIR/file
hs rekognition_tag get mytag $TDIR/file
# RECURSIVE TAG RELATED
hs rekognition_tag add --recursive mytag -e 'EXPRESSION(NOW)' $TDIR/dir1
hs rekognition_tag set --recursive mytag -e 'EXPRESSION(NOW)' $TDIR/dir1
hs rekognition_tag get mytag $TDIR/dir1/file
hs rekognition_tag get --recursive mytag $TDIR/dir1/file
hs rekognition_tag get --recursive --raw mytag $TDIR/dir1/file
hs rekognition_tag get --recursive --compact mytag $TDIR/dir1/file
hs rekognition_tag get --recursive --local mytag $TDIR/dir1/file
hs rekognition_tag get --recursive --local --raw mytag $TDIR/dir1/file
hs rekognition_tag get --recursive --local --compact mytag $TDIR/dir1/file
hs rekognition_tag get --recursive --inherited mytag $TDIR/dir1/file
hs rekognition_tag get --recursive --inherited --raw mytag $TDIR/dir1/file
hs rekognition_tag get --recursive --inherited --compact mytag $TDIR/dir1/file
hs rekognition_tag get --recursive --object mytag $TDIR/dir1/file
hs rekognition_tag get --recursive --object --raw mytag $TDIR/dir1/file
hs rekognition_tag get --recursive --object --compact mytag $TDIR/dir1/file
hs rekognition_tag get --recursive --unbound mytag $TDIR/dir1/file
hs rekognition_tag get --recursive --unbound --raw mytag $TDIR/dir1/file
hs rekognition_tag get --recursive --unbound --compact mytag $TDIR/dir1/file
hs rekognition_tag get --recursive --unbound --local mytag $TDIR/dir1/file
hs rekognition_tag get --recursive --unbound --local --raw mytag $TDIR/dir1/file
hs rekognition_tag get --recursive --unbound --local --compact mytag $TDIR/dir1/file
hs rekognition_tag get --recursive --unbound --inherited mytag $TDIR/dir1/file
hs rekognition_tag get --recursive --unbound --inherited --raw mytag $TDIR/dir1/file
hs rekognition_tag get --recursive --unbound --inherited --compact mytag $TDIR/dir1/file
hs rekognition_tag get --recursive --unbound --object mytag $TDIR/dir1/file
hs rekognition_tag get --recursive --unbound --object --raw mytag $TDIR/dir1/file
hs rekognition_tag get --recursive --unbound --object --compact mytag $TDIR/dir1/file
hs rekognition_tag has --recursive mytag $TDIR/dir1/file
hs rekognition_tag has --recursive --raw mytag $TDIR/dir1/file
hs rekognition_tag has --recursive --compact mytag $TDIR/dir1/file
hs rekognition_tag has --recursive --local mytag $TDIR/dir1/file
hs rekognition_tag has --recursive --local --raw mytag $TDIR/dir1/file
hs rekognition_tag has --recursive --local --compact mytag $TDIR/dir1/file
hs rekognition_tag has --recursive --inherited mytag $TDIR/dir1/file
hs rekognition_tag has --recursive --inherited --raw mytag $TDIR/dir1/file
hs rekognition_tag has --recursive --inherited --compact mytag $TDIR/dir1/file
hs rekognition_tag has --recursive --object mytag $TDIR/dir1/file
hs rekognition_tag has --recursive --object --raw mytag $TDIR/dir1/file
hs rekognition_tag has --recursive --object --compact mytag $TDIR/dir1/file
hs rekognition_tag delete --recursive mytag $TDIR/dir1
hs rekognition_tag delete --recursive --force mytag $TDIR/dir1
hs rekognition_tag get mytag $TDIR/dir1/file
# NONFILES TAG RELATED
hs rekognition_tag add --nonfiles mytag -e 'EXPRESSION(NOW)' $TDIR/dir1
hs rekognition_tag set --nonfiles mytag -e 'EXPRESSION(NOW)' $TDIR/dir1
hs rekognition_tag get mytag $TDIR/dir1/file
hs rekognition_tag get --nonfiles mytag $TDIR/dir1/file
hs rekognition_tag get --nonfiles --raw mytag $TDIR/dir1/file
hs rekognition_tag get --nonfiles --compact mytag $TDIR/dir1/file
hs rekognition_tag get --nonfiles --local mytag $TDIR/dir1/file
hs rekognition_tag get --nonfiles --local --raw mytag $TDIR/dir1/file
hs rekognition_tag get --nonfiles --local --compact mytag $TDIR/dir1/file
hs rekognition_tag get --nonfiles --inherited mytag $TDIR/dir1/file
hs rekognition_tag get --nonfiles --inherited --raw mytag $TDIR/dir1/file
hs rekognition_tag get --nonfiles --inherited --compact mytag $TDIR/dir1/file
hs rekognition_tag get --nonfiles --object mytag $TDIR/dir1/file
hs rekognition_tag get --nonfiles --object --raw mytag $TDIR/dir1/file
hs rekognition_tag get --nonfiles --object --compact mytag $TDIR/dir1/file
hs rekognition_tag get --nonfiles --unbound mytag $TDIR/dir1/file
hs rekognition_tag get --nonfiles --unbound --raw mytag $TDIR/dir1/file
hs rekognition_tag get --nonfiles --unbound --compact mytag $TDIR/dir1/file
hs rekognition_tag get --nonfiles --unbound --local mytag $TDIR/dir1/file
hs rekognition_tag get --nonfiles --unbound --local --raw mytag $TDIR/dir1/file
hs rekognition_tag get --nonfiles --unbound --local --compact mytag $TDIR/dir1/file
hs rekognition_tag get --nonfiles --unbound --inherited mytag $TDIR/dir1/file
hs rekognition_tag get --nonfiles --unbound --inherited --raw mytag $TDIR/dir1/file
hs rekognition_tag get --nonfiles --unbound --inherited --compact mytag $TDIR/dir1/file
hs rekognition_tag get --nonfiles --unbound --object mytag $TDIR/dir1/file
hs rekognition_tag get --nonfiles --unbound --object --raw mytag $TDIR/dir1/file
hs rekognition_tag get --nonfiles --unbound --object --compact mytag $TDIR/dir1/file
hs rekognition_tag has --nonfiles mytag $TDIR/dir1/file
hs rekognition_tag has --nonfiles --raw mytag $TDIR/dir1/file
hs rekognition_tag has --nonfiles --compact mytag $TDIR/dir1/file
hs rekognition_tag has --nonfiles --local mytag $TDIR/dir1/file
hs rekognition_tag has --nonfiles --local --raw mytag $TDIR/dir1/file
hs rekognition_tag has --nonfiles --local --compact mytag $TDIR/dir1/file
hs rekognition_tag has --nonfiles --inherited mytag $TDIR/dir1/file
hs rekognition_tag has --nonfiles --inherited --raw mytag $TDIR/dir1/file
hs rekognition_tag has --nonfiles --inherited --compact mytag $TDIR/dir1/file
hs rekognition_tag has --nonfiles --object mytag $TDIR/dir1/file
hs rekognition_tag has --nonfiles --object --raw mytag $TDIR/dir1/file
hs rekognition_tag has --nonfiles --object --compact mytag $TDIR/dir1/file
hs rekognition_tag delete --nonfiles mytag $TDIR/dir1
hs rekognition_tag delete --nonfiles --force mytag $TDIR/dir1
hs rekognition_tag get mytag $TDIR/dir1/file
# CONTINUOUSLY EVALUATED FORMULA TAGS
hs rekognition_tag set mytag -e 'EXPRESSION(NOW)' $TDIR/dir1
hs rekognition_tag get mytag $TDIR/dir1
hs rekognition_tag set --unbound mytag -e 'NOW' $TDIR/dir1
hs rekognition_tag get --unbound mytag $TDIR/dir1 # cat $TDIR/file?.eval GET_REKOGNITION_TAG_UNBOUND("mytag")
hs rekognition_tag get mytag $TDIR/dir1
sleep 2
hs rekognition_tag get mytag $TDIR/dir1
hs rekognition_tag get --raw mytag $TDIR/dir1
hs rekognition_tag get --compact mytag $TDIR/dir1
hs rekognition_tag delete mytag $TDIR/dir1
hs rekognition_tag delete --force mytag $TDIR/dir1
# FROM WITHIN A SCRIPT
#hs eval 'set_rekognition_tag("mytag", "1gbyte")' $TDIR/file # XXX this doesn't seem to take, should it?
hs rekognition_tag set mytag -e 1gbyte $TDIR/file
# hs eval -e 'get_rekognition_tag("mytag")==1gbyte' $TDIR/file
# THIS ONE IS EXPECTED TO RETURN AN ERROR hs eval -e 'get_rekognition_tag("mytag")=="1gbyte"' $TDIR/file
hs eval -e 'get_rekognition_tag("mytag")' $TDIR/file
hs rekognition_tag set mytag -e 'EXPRESSION(NOW)' $TDIR/dir1
hs eval -e 'get_rekognition_tag("mytag")' $TDIR/file
hs eval -e 'get_rekognition_tag_local("mytag")' $TDIR/file
hs eval -e 'get_rekognition_tag_inherited("mytag")' $TDIR/file
hs eval -e 'get_rekognition_tag_unbound("mytag")' $TDIR/file
hs eval -e 'get_rekognition_tag_local_unbound("mytag")' $TDIR/file
hs eval -e 'get_rekognition_tag_inherited_unbound("mytag")' $TDIR/file
hs eval -e 'has_rekognition_tag("mytag")' $TDIR/file
hs eval -e 'has_rekognition_tag_local("mytag")' $TDIR/file
hs eval -e 'has_rekognition_tag_inherited("mytag")' $TDIR/file
hs eval -e 'list_rekognition_tags' $TDIR/file
hs eval -e 'list_rekognition_tags_local' $TDIR/file
hs eval -e 'list_rekognition_tags_inherited' $TDIR/file
hs eval -e 'attributes.#TAGS' $TDIR/file
hs rekognition_tag delete mytag $TDIR/file
}
function test_rekognition_tags_json {
# TAG RELATED
hs --json rekognition_tag add mytag -e 1gbyte $TDIR/file # Need to implement tag add
hs --json rekognition_tag get mytag $TDIR/file
hs --json rekognition_tag set mytag -e "80%" $TDIR/file
hs --json rekognition_tag get --local mytag $TDIR/file
hs --json rekognition_tag get --inherited mytag $TDIR/file
hs --json rekognition_tag get --object mytag $TDIR/file
hs --json rekognition_tag has mytag $TDIR/file
hs --json rekognition_tag has --local mytag $TDIR/file
hs --json rekognition_tag has --inherited mytag $TDIR/file
hs --json rekognition_tag has --object mytag $TDIR/file
hs --json rekognition_tag list $TDIR/file
hs --json rekognition_tag list --local $TDIR/file
hs --json rekognition_tag list --inherited $TDIR/file
hs --json rekognition_tag list --object $TDIR/file
# This next line is expected to fail
# hs --json rekognition_tag delete mytag $TDIR/file
hs --json rekognition_tag delete --force mytag $TDIR/file
hs --json rekognition_tag get mytag $TDIR/file
hs --json rekognition_tag set mytag -e "'some string'" --string $TDIR/file
hs --json rekognition_tag get mytag $TDIR/file
hs --json rekognition_tag set mytag -e '#EMPTY' $TDIR/file
hs --json rekognition_tag get mytag $TDIR/file
hs --json rekognition_tag set mytag -e 'OLD_VALUE+1' $TDIR/file
hs --json rekognition_tag get mytag $TDIR/file
hs --json rekognition_tag set mytag -e 'OLD_VALUE+1' $TDIR/file
hs --json rekognition_tag get mytag $TDIR/file
# RECURSIVE TAG RELATED
hs --json rekognition_tag add --recursive mytag -e 'EXPRESSION(NOW)' $TDIR/dir1
hs --json rekognition_tag set --recursive mytag -e 'EXPRESSION(NOW)' $TDIR/dir1
hs --json rekognition_tag get mytag $TDIR/dir1/file
hs --json rekognition_tag get --recursive mytag $TDIR/dir1/file
hs --json rekognition_tag get --recursive --raw mytag $TDIR/dir1/file
hs --json rekognition_tag get --recursive --compact mytag $TDIR/dir1/file
hs --json rekognition_tag get --recursive --local mytag $TDIR/dir1/file
hs --json rekognition_tag get --recursive --local --raw mytag $TDIR/dir1/file
hs --json rekognition_tag get --recursive --local --compact mytag $TDIR/dir1/file
hs --json rekognition_tag get --recursive --inherited mytag $TDIR/dir1/file
hs --json rekognition_tag get --recursive --inherited --raw mytag $TDIR/dir1/file
hs --json rekognition_tag get --recursive --inherited --compact mytag $TDIR/dir1/file
hs --json rekognition_tag get --recursive --object mytag $TDIR/dir1/file
hs --json rekognition_tag get --recursive --object --raw mytag $TDIR/dir1/file
hs --json rekognition_tag get --recursive --object --compact mytag $TDIR/dir1/file
hs --json rekognition_tag get --recursive --unbound mytag $TDIR/dir1/file
hs --json rekognition_tag get --recursive --unbound --raw mytag $TDIR/dir1/file
hs --json rekognition_tag get --recursive --unbound --compact mytag $TDIR/dir1/file
hs --json rekognition_tag get --recursive --unbound --local mytag $TDIR/dir1/file
hs --json rekognition_tag get --recursive --unbound --local --raw mytag $TDIR/dir1/file
hs --json rekognition_tag get --recursive --unbound --local --compact mytag $TDIR/dir1/file
hs --json rekognition_tag get --recursive --unbound --inherited mytag $TDIR/dir1/file
hs --json rekognition_tag get --recursive --unbound --inherited --raw mytag $TDIR/dir1/file
hs --json rekognition_tag get --recursive --unbound --inherited --compact mytag $TDIR/dir1/file
hs --json rekognition_tag get --recursive --unbound --object mytag $TDIR/dir1/file
hs --json rekognition_tag get --recursive --unbound --object --raw mytag $TDIR/dir1/file
hs --json rekognition_tag get --recursive --unbound --object --compact mytag $TDIR/dir1/file
hs --json rekognition_tag has --recursive mytag $TDIR/dir1/file
hs --json rekognition_tag has --recursive --raw mytag $TDIR/dir1/file
hs --json rekognition_tag has --recursive --compact mytag $TDIR/dir1/file
hs --json rekognition_tag has --recursive --local mytag $TDIR/dir1/file
hs --json rekognition_tag has --recursive --local --raw mytag $TDIR/dir1/file
hs --json rekognition_tag has --recursive --local --compact mytag $TDIR/dir1/file
hs --json rekognition_tag has --recursive --inherited mytag $TDIR/dir1/file
hs --json rekognition_tag has --recursive --inherited --raw mytag $TDIR/dir1/file
hs --json rekognition_tag has --recursive --inherited --compact mytag $TDIR/dir1/file
hs --json rekognition_tag has --recursive --object mytag $TDIR/dir1/file
hs --json rekognition_tag has --recursive --object --raw mytag $TDIR/dir1/file
hs --json rekognition_tag has --recursive --object --compact mytag $TDIR/dir1/file
hs --json rekognition_tag delete --recursive mytag $TDIR/dir1
hs --json rekognition_tag delete --recursive --force mytag $TDIR/dir1
hs --json rekognition_tag get mytag $TDIR/dir1/file
# NONFILES TAG RELATED
hs --json rekognition_tag add --nonfiles mytag -e 'EXPRESSION(NOW)' $TDIR/dir1
hs --json rekognition_tag set --nonfiles mytag -e 'EXPRESSION(NOW)' $TDIR/dir1
hs --json rekognition_tag get mytag $TDIR/dir1/file
hs --json rekognition_tag get --nonfiles mytag $TDIR/dir1/file
hs --json rekognition_tag get --nonfiles --raw mytag $TDIR/dir1/file
hs --json rekognition_tag get --nonfiles --compact mytag $TDIR/dir1/file
hs --json rekognition_tag get --nonfiles --local mytag $TDIR/dir1/file
hs --json rekognition_tag get --nonfiles --local --raw mytag $TDIR/dir1/file
hs --json rekognition_tag get --nonfiles --local --compact mytag $TDIR/dir1/file
hs --json rekognition_tag get --nonfiles --inherited mytag $TDIR/dir1/file
hs --json rekognition_tag get --nonfiles --inherited --raw mytag $TDIR/dir1/file
hs --json rekognition_tag get --nonfiles --inherited --compact mytag $TDIR/dir1/file
hs --json rekognition_tag get --nonfiles --object mytag $TDIR/dir1/file
hs --json rekognition_tag get --nonfiles --object --raw mytag $TDIR/dir1/file
hs --json rekognition_tag get --nonfiles --object --compact mytag $TDIR/dir1/file
hs --json rekognition_tag get --nonfiles --unbound mytag $TDIR/dir1/file
hs --json rekognition_tag get --nonfiles --unbound --raw mytag $TDIR/dir1/file
hs --json rekognition_tag get --nonfiles --unbound --compact mytag $TDIR/dir1/file
hs --json rekognition_tag get --nonfiles --unbound --local mytag $TDIR/dir1/file
hs --json rekognition_tag get --nonfiles --unbound --local --raw mytag $TDIR/dir1/file
hs --json rekognition_tag get --nonfiles --unbound --local --compact mytag $TDIR/dir1/file
hs --json rekognition_tag get --nonfiles --unbound --inherited mytag $TDIR/dir1/file
hs --json rekognition_tag get --nonfiles --unbound --inherited --raw mytag $TDIR/dir1/file
hs --json rekognition_tag get --nonfiles --unbound --inherited --compact mytag $TDIR/dir1/file
hs --json rekognition_tag get --nonfiles --unbound --object mytag $TDIR/dir1/file
hs --json rekognition_tag get --nonfiles --unbound --object --raw mytag $TDIR/dir1/file
hs --json rekognition_tag get --nonfiles --unbound --object --compact mytag $TDIR/dir1/file
hs --json rekognition_tag has --nonfiles mytag $TDIR/dir1/file
hs --json rekognition_tag has --nonfiles --raw mytag $TDIR/dir1/file
hs --json rekognition_tag has --nonfiles --compact mytag $TDIR/dir1/file
hs --json rekognition_tag has --nonfiles --local mytag $TDIR/dir1/file
hs --json rekognition_tag has --nonfiles --local --raw mytag $TDIR/dir1/file
hs --json rekognition_tag has --nonfiles --local --compact mytag $TDIR/dir1/file
hs --json rekognition_tag has --nonfiles --inherited mytag $TDIR/dir1/file
hs --json rekognition_tag has --nonfiles --inherited --raw mytag $TDIR/dir1/file
hs --json rekognition_tag has --nonfiles --inherited --compact mytag $TDIR/dir1/file
hs --json rekognition_tag has --nonfiles --object mytag $TDIR/dir1/file
hs --json rekognition_tag has --nonfiles --object --raw mytag $TDIR/dir1/file
hs --json rekognition_tag has --nonfiles --object --compact mytag $TDIR/dir1/file
hs --json rekognition_tag delete --nonfiles mytag $TDIR/dir1
hs --json rekognition_tag delete --nonfiles --force mytag $TDIR/dir1
hs --json rekognition_tag get mytag $TDIR/dir1/file
# CONTINUOUSLY EVALUATED FORMULA TAGS
hs --json rekognition_tag set mytag -e 'EXPRESSION(NOW)' $TDIR/dir1
hs --json rekognition_tag get mytag $TDIR/dir1
hs --json rekognition_tag set --unbound mytag -e 'NOW' $TDIR/dir1
hs --json rekognition_tag get --unbound mytag $TDIR/dir1 # cat $TDIR/file?.eval GET_REKOGNITION_TAG_UNBOUND("mytag")
hs --json rekognition_tag get mytag $TDIR/dir1
sleep 2
hs --json rekognition_tag get mytag $TDIR/dir1
hs --json rekognition_tag get --raw mytag $TDIR/dir1
hs --json rekognition_tag get --compact mytag $TDIR/dir1
hs --json rekognition_tag delete mytag $TDIR/dir1
hs --json rekognition_tag delete --force mytag $TDIR/dir1
# FROM WITHIN A SCRIPT
#hs --json eval 'set_rekognition_tag("mytag", "1gbyte")' $TDIR/file # XXX this doesn't seem to take, should it?
hs --json rekognition_tag set mytag -e 1gbyte $TDIR/file
# hs --json eval -e 'get_rekognition_tag("mytag")==1gbyte' $TDIR/file
# THIS ONE IS EXPECTED TO RETURN AN ERROR hs --json eval -e 'get_rekognition_tag("mytag")=="1gbyte"' $TDIR/file
hs --json eval -e 'get_rekognition_tag("mytag")' $TDIR/file
hs --json rekognition_tag set mytag -e 'EXPRESSION(NOW)' $TDIR/dir1
hs --json eval -e 'get_rekognition_tag("mytag")' $TDIR/file
hs --json eval -e 'get_rekognition_tag_local("mytag")' $TDIR/file
hs --json eval -e 'get_rekognition_tag_inherited("mytag")' $TDIR/file
hs --json eval -e 'get_rekognition_tag_unbound("mytag")' $TDIR/file
hs --json eval -e 'get_rekognition_tag_local_unbound("mytag")' $TDIR/file
hs --json eval -e 'get_rekognition_tag_inherited_unbound("mytag")' $TDIR/file
hs --json eval -e 'has_rekognition_tag("mytag")' $TDIR/file
hs --json eval -e 'has_rekognition_tag_local("mytag")' $TDIR/file
hs --json eval -e 'has_rekognition_tag_inherited("mytag")' $TDIR/file
hs --json eval -e 'list_rekognition_tags' $TDIR/file
hs --json eval -e 'list_rekognition_tags_local' $TDIR/file
hs --json eval -e 'list_rekognition_tags_inherited' $TDIR/file
hs --json eval -e 'attributes.#TAGS' $TDIR/file
hs --json rekognition_tag delete mytag $TDIR/file
}
function test_keywords {
# KEYWORD RELATED
hs keyword has mykeyword $TDIR/file
hs keyword add mykeyword $TDIR/file
hs keyword has mykeyword $TDIR/file
hs keyword has --local mykeyword $TDIR/file
hs keyword has --inherited mykeyword $TDIR/file
hs keyword has --object mykeyword $TDIR/file
hs keyword list $TDIR/file
hs keyword list --local $TDIR/file
hs keyword list --inherited $TDIR/file
hs keyword list --object $TDIR/file
# This next line is expected to fail
# hs keyword delete mykeyword $TDIR/file
hs keyword delete --force mykeyword $TDIR/file
hs keyword has mykeyword $TDIR/file
# RECURSIVE KEYWORD RELATED
hs keyword has mykeyword $TDIR/dir1/file
hs keyword add --recursive mykeyword $TDIR/dir1
hs keyword has mykeyword $TDIR/dir1/file
hs keyword has --recursive mykeyword $TDIR/dir1/file
hs keyword has --recursive --raw mykeyword $TDIR/dir1/file
hs keyword has --recursive --compact mykeyword $TDIR/dir1/file
hs keyword has --recursive --local mykeyword $TDIR/dir1/file
hs keyword has --recursive --local --raw mykeyword $TDIR/dir1/file
hs keyword has --recursive --local --compact mykeyword $TDIR/dir1/file
hs keyword has --recursive --inherited mykeyword $TDIR/dir1/file
hs keyword has --recursive --inherited --raw mykeyword $TDIR/dir1/file
hs keyword has --recursive --inherited --compact mykeyword $TDIR/dir1/file
hs keyword has --recursive --object mykeyword $TDIR/dir1/file
hs keyword has --recursive --object --raw mykeyword $TDIR/dir1/file
hs keyword has --recursive --object --compact mykeyword $TDIR/dir1/file
hs keyword delete --recursive mykeyword $TDIR/dir1
hs keyword delete --recursive --force mykeyword $TDIR/dir1
hs keyword has mykeyword $TDIR/dir1/file
hs keyword has --raw mykeyword $TDIR/dir1/file # XXX Exists?
hs keyword has --compact mykeyword $TDIR/dir1/file # XXX Exists?
# NONFILES KEYWORD RELATED
hs keyword has mykeyword $TDIR/dir1/file
hs keyword add --nonfiles mykeyword $TDIR/dir1
hs keyword has mykeyword $TDIR/dir1/file
hs keyword has --nonfiles mykeyword $TDIR/dir1/file
hs keyword has --nonfiles --raw mykeyword $TDIR/dir1/file
hs keyword has --nonfiles --compact mykeyword $TDIR/dir1/file
hs keyword has --nonfiles --local mykeyword $TDIR/dir1/file
hs keyword has --nonfiles --local --raw mykeyword $TDIR/dir1/file
hs keyword has --nonfiles --local --compact mykeyword $TDIR/dir1/file
hs keyword has --nonfiles --inherited mykeyword $TDIR/dir1/file
hs keyword has --nonfiles --inherited --raw mykeyword $TDIR/dir1/file
hs keyword has --nonfiles --inherited --compact mykeyword $TDIR/dir1/file
hs keyword has --nonfiles --object mykeyword $TDIR/dir1/file
hs keyword has --nonfiles --object --raw mykeyword $TDIR/dir1/file
hs keyword has --nonfiles --object --compact mykeyword $TDIR/dir1/file
hs keyword delete --nonfiles mykeyword $TDIR/dir1
hs keyword delete --nonfiles --force mykeyword $TDIR/dir1
hs keyword has mykeyword $TDIR/dir1/file
hs keyword has --raw mykeyword $TDIR/dir1/file # XXX Exists?
hs keyword has --compact mykeyword $TDIR/dir1/file # XXX Exists?
# KEYWORD FROM WITHIN A SCRIPT
hs keyword add mykeyword $TDIR/file
hs eval -e 'has_keyword("mykeyword")' $TDIR/file
hs eval -e 'has_keyword_local("mykeyword")' $TDIR/file
hs eval -e 'has_keyword_inherited("mykeyword")' $TDIR/file
hs eval -e 'list_keywords' $TDIR/file
hs eval -e 'list_keywords_local' $TDIR/file