-
Notifications
You must be signed in to change notification settings - Fork 0
606 lines (546 loc) · 30.9 KB
/
code-coverage.yml
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
name: Code_Coverage
on:
push:
branches:
- main
pull_request:
concurrency:
# New commit on branch cancels a running workflow on the same branch
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
BuildAndTest-Coverage:
strategy:
matrix:
go: ['1.20']
job_name: ['linux']
include:
- job_name: linux
os: ubuntu-latest
containerName: 'test-cnt-ubn'
fuselib: libfuse-dev
fuselib2: fuse
runs-on: ${{ matrix.os }}
env:
MOUNT_DIR: "$HOME/blob_mnt"
TEMP_DIR: "$HOME/cloudfuse_tmp"
WORK_DIR: "."
cloudfuse_ADLS_CFG: "./cloudfuse.adls.yaml"
cloudfuse_CFG: "./cloudfuse.yaml"
cloudfuse_STREAM_CFG: "./cloudfuse_stream.yaml"
timeout-minutes: 300
steps:
- name: checkout
uses: actions/[email protected]
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
check-latest: true
- run: go version
- name: Install libfuse
run: |-
sudo apt-get update --fix-missing -o Dpkg::Options::="--force-confnew"
sudo apt-get install make cmake gcc g++ parallel ${{ matrix.fuselib }} ${{ matrix.fuselib2 }} -y -o Dpkg::Options::="--force-confnew"
- name: Create Directory Structure
run: |-
sudo mkdir -p ${{ env.MOUNT_DIR }}
sudo chown -R `whoami` ${{ env.MOUNT_DIR }}
chmod 777 ${{ env.MOUNT_DIR }}
sudo mkdir -p ${{ env.TEMP_DIR }}
sudo chown -R `whoami` ${{ env.TEMP_DIR }}
chmod 777 ${{ env.TEMP_DIR }}
- name: Build
run: |
./build.sh
- name: Create Azure Configuration File
run: |-
cnfFile=$HOME/azuretest.json
echo $cnfFile
touch $cnfFile
echo "{" > $cnfFile
echo "\"block-acct\"": "\"${{ secrets.AZTEST_BLOCK_ACC_NAME }}\"", >> $cnfFile
echo "\"adls-acct\"": "\"${{ secrets.AZTEST_ADLS_ACC_NAME }}\"", >> $cnfFile
echo "\"block-cont\"": "\"${{ matrix.containerName }}\"", >> $cnfFile
echo "\"adls-cont\"": "\"${{ matrix.containerName }}\"", >> $cnfFile
echo "\"block-key\"": "\"${{ secrets.AZTEST_BLOCK_KEY }}\"", >> $cnfFile
echo "\"adls-key\"": "\"${{ secrets.AZTEST_ADLS_KEY }}\"", >> $cnfFile
echo "\"block-sas\"": "\"${{ secrets.AZTEST_BLOCK_SAS }}\"", >> $cnfFile
echo "\"block-cont-sas-ubn-18\"": "\"${{ secrets.AZTEST_BLOCK_CONT_SAS_UBN_18 }}\"", >> $cnfFile
echo "\"block-cont-sas-ubn-20\"": "\"${{ secrets.AZTEST_BLOCK_CONT_SAS_UBN_20 }}\"", >> $cnfFile
echo "\"adls-sas\"": "\"${{ secrets.AZTEST_ADLS_SAS }}\"", >> $cnfFile
echo "\"msi-appid\"": "\"${{ secrets.AZTEST_APP_ID }}\"", >> $cnfFile
echo "\"msi-resid\"": "\"${{ secrets.AZTEST_RES_ID }}\"", >> $cnfFile
echo "\"msi-objid\"": "\"${{ secrets.AZTEST_OBJ_ID }}\"", >> $cnfFile
echo "\"spn-client\"": "\"${{ secrets.AZTEST_CLIENT }}\"", >> $cnfFile
echo "\"spn-tenant\"": "\"${{ secrets.AZTEST_TENANT }}\"", >> $cnfFile
echo "\"spn-secret\"": "\"${{ secrets.AZTEST_SECRET }}\"", >> $cnfFile
echo "\"skip-msi\"": "true", >> $cnfFile
echo "\"proxy-address\"": "\"\"" >> $cnfFile
echo "}" >> $cnfFile
- name: Create S3 Configuration File
run: |-
cnfFile=$HOME/s3test.json
echo $cnfFile
touch $cnfFile
echo "{" > $cnfFile
echo "\"bucket-name\"": "\"${{ secrets.S3TEST_BUCKET_NAME }}\"", >> $cnfFile
echo "\"access-key\"": "\"${{ secrets.S3TEST_ACCESS_KEY }}\"", >> $cnfFile
echo "\"secret-key\"": "\"${{ secrets.S3TEST_SECRET_KEY }}\"", >> $cnfFile
echo "\"endpoint\"": "\"${{ secrets.S3TEST_ENDPOINT }}\"", >> $cnfFile
echo "\"region\"": "\"${{ secrets.S3TEST_REGION }}\"" >> $cnfFile
echo "}" >> $cnfFile
- name: UT Code Coverage
run: go test -v -timeout=1h ./... --tags=unittest,storagetest -covermode count -coverprofile ./cloudfuse_ut.cov
- name: Build coverage binary
run: go test -coverpkg="./..." -covermode=count -c -o cloudfuse.test
- name: Create Config File - Block Blob
env:
NIGHTLY_STO_ACC_NAME: "${{ secrets.NIGHTLY_STO_BLOB_ACC_NAME }}"
NIGHTLY_STO_ACC_KEY: "${{ secrets.NIGHTLY_STO_BLOB_ACC_KEY }}"
ACCOUNT_TYPE: block
ACCOUNT_ENDPOINT: https://${{ secrets.NIGHTLY_STO_BLOB_ACC_NAME }}.blob.core.windows.net
VERBOSE_LOG: false
USE_HTTP: false
run: "./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/cloudfuse_gentest1.cov gen-test-config --config-file=azure_key.yaml --container-name=${{ matrix.containerName }} --temp-path=${{ env.TEMP_DIR }} --output-file=${{ env.cloudfuse_CFG }}"
- name: Block Blob Coverage
run: |-
rm -rf ${{ env.MOUNT_DIR }}/*
rm -rf ${{ env.TEMP_DIR }}/*
./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/cloudfuse_block.cov mount ${{ env.MOUNT_DIR }} --config-file=${{ env.cloudfuse_CFG }} --foreground=true &
sleep 10
ps -aux | grep cloudfuse
rm -rf ${{ env.MOUNT_DIR }}/*
cd test/e2e_tests
go test -v -timeout=7200s ./... -args -mnt-path=${{ env.MOUNT_DIR }} -tmp-path=${{ env.TEMP_DIR }}
cd -
sudo fusermount -u ${{ env.MOUNT_DIR }}
sleep 5
- name: Block Blob Coverage with profilers
run: |-
rm -rf ${{ env.MOUNT_DIR }}/*
rm -rf ${{ env.TEMP_DIR }}/*
cp ${{ env.cloudfuse_CFG }} /tmp/configBlockProfilerTemp.yaml
echo "dynamic-profile: true" >> /tmp/configBlockProfilerTemp.yaml
echo "cpu-profile: /tmp/cpuBlockProfTmp" >> /tmp/configBlockProfilerTemp.yaml
echo "mem-profile: /tmp/memBlockProfTmp" >> /tmp/configBlockProfilerTemp.yaml
echo "health_monitor:" >> /tmp/configBlockProfilerTemp.yaml
echo " enable-monitoring: true" >> /tmp/configBlockProfilerTemp.yaml
echo " monitor-disable-list:" >> /tmp/configBlockProfilerTemp.yaml
echo " - cloudfuse_stats" >> /tmp/configBlockProfilerTemp.yaml
cat /tmp/configBlockProfilerTemp.yaml
./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/cloudfuse_block_profiler.cov mount ${{ env.MOUNT_DIR }} --config-file=/tmp/configBlockProfilerTemp.yaml --foreground=true &
sleep 10
ps -aux | grep cloudfuse
rm -rf ${{ env.MOUNT_DIR }}/*
cd test/e2e_tests
go test -v -timeout=7200s ./... -args -mnt-path=${{ env.MOUNT_DIR }} -tmp-path=${{ env.TEMP_DIR }}
cd -
sudo fusermount -u ${{ env.MOUNT_DIR }}
sleep 5
- name: Create Config File - ADLS
env:
NIGHTLY_STO_ACC_NAME: "${{ secrets.AZTEST_ADLS_ACC_NAME }}"
NIGHTLY_STO_ACC_KEY: "${{ secrets.AZTEST_ADLS_KEY }}"
ACCOUNT_TYPE: adls
ACCOUNT_ENDPOINT: https://${{ secrets.AZTEST_ADLS_ACC_NAME }}.dfs.core.windows.net
VERBOSE_LOG: false
USE_HTTP: false
run: "./cloudfuse.test gen-test-config --config-file=azure_key.yaml --container-name=${{ matrix.containerName }} --temp-path=${{ env.TEMP_DIR }} --output-file=${{ env.cloudfuse_ADLS_CFG }}"
- name: ADLS Coverage
run: |-
rm -rf ${{ env.MOUNT_DIR }}/*
rm -rf ${{ env.TEMP_DIR }}/*
./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/cloudfuse_adls.cov mount ${{ env.MOUNT_DIR }} --config-file=${{ env.cloudfuse_ADLS_CFG }} --foreground=true &
sleep 10
ps -aux | grep cloudfuse
rm -rf ${{ env.MOUNT_DIR }}/*
cd test/e2e_tests
go test -v -timeout=7200s ./... -args -mnt-path=${{ env.MOUNT_DIR }} -adls=true -tmp-path=${{ env.TEMP_DIR }}
cd -
sudo fusermount -u ${{ env.MOUNT_DIR }}
sleep 5
- name: ADLS Coverage with profilers
run: |-
rm -rf ${{ env.MOUNT_DIR }}/*
rm -rf ${{ env.TEMP_DIR }}/*
cp ${{ env.cloudfuse_ADLS_CFG }} /tmp/configAdlsProfilerTemp.yaml
echo "dynamic-profile: true" >> /tmp/configAdlsProfilerTemp.yaml
echo "cpu-profile: /tmp/cpuAdlsProfTmp" >> /tmp/configAdlsProfilerTemp.yaml
echo "mem-profile: /tmp/memAdlsProfTmp" >> /tmp/configAdlsProfilerTemp.yaml
echo "health_monitor:" >> /tmp/configAdlsProfilerTemp.yaml
echo " enable-monitoring: true" >> /tmp/configAdlsProfilerTemp.yaml
echo " monitor-disable-list:" >> /tmp/configAdlsProfilerTemp.yaml
echo " - cloudfuse_stats" >> /tmp/configAdlsProfilerTemp.yaml
cat /tmp/configAdlsProfilerTemp.yaml
./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/cloudfuse_adls_profiler.cov mount ${{ env.MOUNT_DIR }} --config-file=/tmp/configAdlsProfilerTemp.yaml --foreground=true &
sleep 10
ps -aux | grep cloudfuse
rm -rf ${{ env.MOUNT_DIR }}/*
cd test/e2e_tests
go test -v -timeout=7200s ./... -args -mnt-path=${{ env.MOUNT_DIR }} -tmp-path=${{ env.TEMP_DIR }}
cd -
sudo fusermount -u ${{ env.MOUNT_DIR }}
sleep 5
- name: Create Config File - S3
env:
S3_BUCKET_NAME: "${{ secrets.S3TEST_BUCKET_NAME }}"
S3_ENDPOINT: "${{ secrets.S3TEST_ENDPOINT }}"
S3_KEY_ID: "${{ secrets.S3TEST_ACCESS_KEY }}"
S3_REGION: "${{ secrets.S3TEST_REGION }}"
S3_SECRET_KEY: "${{ secrets.S3TEST_SECRET_KEY }}"
run: "./cloudfuse.test gen-test-config --config-file=s3_key.yaml --temp-path=${{ env.TEMP_DIR }} --output-file=${{ env.cloudfuse_CFG }}"
- name: S3 Coverage
run: |-
rm -rf ${{ env.MOUNT_DIR }}/*
rm -rf ${{ env.TEMP_DIR }}/*
./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/cloudfuse_s3.cov mount ${{ env.MOUNT_DIR }} --config-file=${{ env.cloudfuse_CFG }} --foreground=true &
sleep 10
ps -aux | grep cloudfuse
cd test/e2e_tests
go test -v -timeout=7200s ./... -args -mnt-path=${{ env.MOUNT_DIR }} -tmp-path=${{ env.TEMP_DIR }}
cd -
sudo fusermount -u ${{ env.MOUNT_DIR }}
sleep 5
- name: S3 Coverage with profilers
run: |-
rm -rf ${{ env.MOUNT_DIR }}/*
rm -rf ${{ env.TEMP_DIR }}/*
cp ${{ env.cloudfuse_CFG }} /tmp/configBlockProfilerTemp.yaml
echo "dynamic-profile: true" >> /tmp/configBlockProfilerTemp.yaml
echo "cpu-profile: /tmp/cpuBlockProfTmp" >> /tmp/configBlockProfilerTemp.yaml
echo "mem-profile: /tmp/memBlockProfTmp" >> /tmp/configBlockProfilerTemp.yaml
echo "health_monitor:" >> /tmp/configBlockProfilerTemp.yaml
echo " enable-monitoring: true" >> /tmp/configBlockProfilerTemp.yaml
echo " monitor-disable-list:" >> /tmp/configBlockProfilerTemp.yaml
echo " - cloudfuse_stats" >> /tmp/configBlockProfilerTemp.yaml
cat /tmp/configBlockProfilerTemp.yaml
./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/cloudfuse_s3_profiler.cov mount ${{ env.MOUNT_DIR }} --config-file=/tmp/configBlockProfilerTemp.yaml --foreground=true &
sleep 10
ps -aux | grep cloudfuse
cd test/e2e_tests
go test -v -timeout=7200s ./... -args -mnt-path=${{ env.MOUNT_DIR }} -tmp-path=${{ env.TEMP_DIR }}
cd -
sudo fusermount -u ${{ env.MOUNT_DIR }}
sleep 5
- name: Create Config File - LFU
env:
NIGHTLY_STO_ACC_NAME: "${{ secrets.NIGHTLY_STO_BLOB_ACC_NAME }}"
NIGHTLY_STO_ACC_KEY: "${{ secrets.NIGHTLY_STO_BLOB_ACC_KEY }}"
ACCOUNT_TYPE: block
ACCOUNT_ENDPOINT: https://${{ secrets.NIGHTLY_STO_BLOB_ACC_NAME }}.blob.core.windows.net
VERBOSE_LOG: false
run: "./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/cloudfuse_gentest2.cov gen-test-config --config-file=azure_key_lfu.yaml --container-name=${{ matrix.containerName }} --temp-path=${{ env.TEMP_DIR }} --output-file=${{ env.cloudfuse_CFG }}"
- name: Block Blob LFU Coverage
run: |-
rm -rf ${{ env.MOUNT_DIR }}/*
rm -rf ${{ env.TEMP_DIR }}/*
./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/cloudfuse_block_lfu.cov mount ${{ env.MOUNT_DIR }} --config-file=${{ env.cloudfuse_CFG }} --foreground=true &
sleep 10
ps -aux | grep cloudfuse
rm -rf ${{ env.MOUNT_DIR }}/*
cd test/e2e_tests
go test -v -timeout=7200s ./... -args -mnt-path=${{ env.MOUNT_DIR }} -tmp-path=${{ env.TEMP_DIR }}
cd -
sudo fusermount -u ${{ env.MOUNT_DIR }}
sleep 5
working-directory: "${{ env.WORK_DIR }}"
- name: Create Config File - S3 LFU
env:
S3_BUCKET_NAME: "${{ secrets.S3TEST_BUCKET_NAME }}"
S3_ENDPOINT: "${{ secrets.S3TEST_ENDPOINT }}"
S3_KEY_ID: "${{ secrets.S3TEST_ACCESS_KEY }}"
S3_REGION: "${{ secrets.S3TEST_REGION }}"
S3_SECRET_KEY: "${{ secrets.S3TEST_SECRET_KEY }}"
run: "./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/cloudfuse_gentest2_s3.cov gen-test-config --config-file=s3_key_lfu.yaml --container-name=${{ matrix.containerName }} --temp-path=${{ env.TEMP_DIR }} --output-file=${{ env.cloudfuse_CFG }}"
- name: S3 LFU Coverage
run: |-
rm -rf ${{ env.MOUNT_DIR }}/*
rm -rf ${{ env.TEMP_DIR }}/*
./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/cloudfuse_s3_lfu.cov mount ${{ env.MOUNT_DIR }} --config-file=${{ env.cloudfuse_CFG }} --foreground=true &
sleep 10
ps -aux | grep cloudfuse
cd test/e2e_tests
go test -v -timeout=7200s ./... -args -mnt-path=${{ env.MOUNT_DIR }} -tmp-path=${{ env.TEMP_DIR }}
cd -
sudo fusermount -u ${{ env.MOUNT_DIR }}
sleep 5
- name: Create Config File - Stream
env:
NIGHTLY_STO_ACC_NAME: "${{ secrets.NIGHTLY_STO_BLOB_ACC_NAME }}"
NIGHTLY_STO_ACC_KEY: "${{ secrets.NIGHTLY_STO_BLOB_ACC_KEY }}"
ACCOUNT_TYPE: block
ACCOUNT_ENDPOINT: https://${{ secrets.NIGHTLY_STO_BLOB_ACC_NAME }}.blob.core.windows.net
VERBOSE_LOG: false
run: "./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/cloudfuse_gentest3.cov gen-test-config --config-file=azure_stream.yaml --container-name=${{ matrix.containerName }} --temp-path=${{ env.TEMP_DIR }} --output-file=${{ env.cloudfuse_STREAM_CFG }}"
- name: Block Blob Stream Preparation
run: "rm -rf ${{ env.MOUNT_DIR }}/*\nrm -rf ${{ env.TEMP_DIR }}/*\n./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/cloudfuse_stream_prep.cov mount ${{ env.MOUNT_DIR }} --config-file=${{ env.cloudfuse_STREAM_CFG }} --foreground=true &\nsleep 10\nps -aux | grep cloudfuse\nfor i in {10,50,100}; do echo $i; done | parallel --will-cite -j 5 'head -c {}M < /dev/urandom > ${{ env.WORK_DIR }}/myfile_{}'\nfor i in {10,50,100}; do echo $i; done | parallel --will-cite -j 5 'cp ${{ env.WORK_DIR }}/myfile_{} ${{ env.MOUNT_DIR }}/'\nsudo fusermount -u ${{ env.MOUNT_DIR }} \nsleep 5"
- name: Block Blob Stream Coverage
run: "rm -rf ${{ env.MOUNT_DIR }}/*\nrm -rf ${{ env.TEMP_DIR }}/*\n./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/cloudfuse_stream.cov mount ${{ env.MOUNT_DIR }} --config-file=${{ env.cloudfuse_STREAM_CFG }} --foreground=true &\nsleep 10\nps -aux | grep cloudfuse\nrm -rf ${{ env.MOUNT_DIR }}/*\ncd test/e2e_tests\ngo test -v -timeout=7200s ./... -args -mnt-path=${{ env.MOUNT_DIR }} -tmp-path=${{ env.TEMP_DIR }}\ncd -\nsudo fusermount -u ${{ env.MOUNT_DIR }} \nsleep 5"
- name: Create Config File - Block Blob
env:
NIGHTLY_STO_ACC_NAME: "${{ secrets.NIGHTLY_STO_BLOB_ACC_NAME }}"
NIGHTLY_STO_ACC_KEY: "${{ secrets.NIGHTLY_STO_BLOB_ACC_KEY }}"
ACCOUNT_TYPE: block
ACCOUNT_ENDPOINT: https://${{ secrets.NIGHTLY_STO_BLOB_ACC_NAME }}.blob.core.windows.net
VERBOSE_LOG: false
USE_HTTP: false
run: "./cloudfuse.test gen-test-config --config-file=azure_key.yaml --container-name=${{ matrix.containerName }} --temp-path=${{ env.TEMP_DIR }} --output-file=${{ env.cloudfuse_CFG }}"
- name: 'CLI : Component Generation'
run: |-
./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/generate_cmd.cov generate test_component
if [ $? -ne 0 ]; then
exit 1
fi
- name: 'CLI : Mount List'
run: |-
rm -rf ${{ env.MOUNT_DIR }}/*
rm -rf ${{ env.TEMP_DIR }}/*
./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/list_empty_cmd.cov mount list
if [ $? -ne 0 ]; then
exit 1
fi
- name: 'CLI : Mount all and List'
run: "./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/mount_cmd.cov mount all ${{ env.MOUNT_DIR }} --config-file=${{ env.cloudfuse_CFG }} --log-level=log_debug \nif [ $? -ne 0 ]; then\n exit 1\nfi\n\nsleep 20 \n\n./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/list_cmd_all.cov mount list\nif [ $? -ne 0 ]; then\n exit 1\nfi\n./cloudfuse.test unmount all"
- name: 'CLI : Unmount options'
shell: bash {0}
run: |-
set +x
./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/mount_cmd_all.cov mount all ${{ env.MOUNT_DIR }} --config-file=${{ env.cloudfuse_CFG }} --log-level=log_debug
if [ $? -ne 0 ]; then
exit 1
fi
sleep 20
cd $(MOUNT_DIR)/$(containerName)
./cloudfuse.test -test.v -test.coverprofile=$(WORK_DIR)/umnt_cmd_cont_fail.cov unmount $(MOUNT_DIR)/$(containerName)
cd -
./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/umnt_cmd_cont.cov unmount ${{ env.MOUNT_DIR }}/${{ matrix.containerName }}
if [ $? -ne 0 ]; then
exit 1
fi
./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/umnt_wild_cmd.cov unmount \"testmut*\"
if [ $? -ne 0 ]; then
exit 1
fi
./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/umnt_wild_cmd.cov unmount \"abcdef*\"
if [ $? -ne 0 ]; then
exit 1
fi
./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/umnt_negative_cmd.cov unmount abcdef
if [ $? -ne 1 ]; then
exit 1
fi
for i in {1..5}; do ./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/umnt_all_cmd$i.cov unmount all; done
- name: 'CLI : Invalid mount path'
timeout-minutes: 2
shell: bash {0}
run: |-
set +x
./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/mount_neg.cov mount all /abc --config-file=${{ env.cloudfuse_CFG }} --log-level=log_debug
if [ $? -eq 0 ]; then
exit 1
fi
- name: 'CLI : Mount all with secure config'
timeout-minutes: 2
run: "./cloudfuse.test unmount all\ncp ${{ env.cloudfuse_CFG }} /tmp/configMountall.yaml\necho \"mountall:\" >> /tmp/configMountall.yaml\necho \" container-allowlist:\" >> /tmp/configMountall.yaml\necho \" - abcd\" >> /tmp/configMountall.yaml\ncat /tmp/configMountall.yaml\n\n./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/secure_encrypt_all.cov secure encrypt --config-file=/tmp/configMountall.yaml --output-file=${{ runner.workspace }}/cloudfuse.azsec --passphrase=123123123123123123123123 \nif [ $? -ne 0 ]; then\n exit 1\nfi\n\n./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/mount_all_cmd_secure.cov mount all ${{ env.MOUNT_DIR }} --config-file=${{ runner.workspace }}/cloudfuse.azsec --passphrase=123123123123123123123123 --log-level=log_debug --foreground=true &\nif [ $? -ne 0 ]; then\n exit 1\nfi\n\nsleep 5\n./cloudfuse.test unmount all"
- name: 'CLI : Mount all with secure config 2'
timeout-minutes: 2
run: "./cloudfuse.test unmount all\ncp ${{ env.cloudfuse_CFG }} /tmp/configMountall.yaml\necho \"mountall:\" >> /tmp/configMountall.yaml\necho \" container-denylist:\" >> /tmp/configMountall.yaml\necho \" - abcd\" >> /tmp/configMountall.yaml\ncat /tmp/configMountall.yaml\n\n./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/secure_encrypt_all2.cov secure encrypt --config-file=/tmp/configMountall.yaml --output-file=${{ runner.workspace }}/cloudfuse.azsec --passphrase=123123123123123123123123 \nif [ $? -ne 0 ]; then\n exit 1\nfi\n\n./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/mount_all_cmd_secure2.cov mount all ${{ env.MOUNT_DIR }} --config-file=${{ runner.workspace }}/cloudfuse.azsec --passphrase=123123123123123123123123 --log-level=log_debug --foreground=true &\nif [ $? -ne 0 ]; then\n exit 1\nfi\n\nsleep 5\n./cloudfuse.test unmount all"
- name: 'CLI : Remount test'
timeout-minutes: 2
shell: bash {0}
run: |-
set +x
./cloudfuse.test unmount all
./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/mount_foreg.cov mount ${{ env.MOUNT_DIR }} --config-file=${{ env.cloudfuse_CFG }} --log-level=log_debug --foreground=true &
if [ $? -ne 0 ]; then
exit 1
fi
sleep 5
./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/mount_remount.cov mount ${{ env.MOUNT_DIR }} --config-file=${{ env.cloudfuse_CFG }} --log-level=log_debug
if [ $? -eq 0 ]; then
exit 1
fi
sleep 5
./cloudfuse.test unmount all
- name: 'CLI : doc generation'
timeout-minutes: 2
shell: bash {0}
run: |-
set +x
./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/doc1.cov doc
./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/doc2.cov doc --output-location /notexists
touch ~/a.txt
./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/doc2.cov doc --output-location ~/a.txt
rm -rf ~/a.txt
- name: 'CLI : version'
timeout-minutes: 2
shell: bash {0}
run: |-
set +x
./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/version1.cov --version
./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/version2.cov version
./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/version2.cov version --check
- name: 'CLI : Config change simulator'
shell: bash {0}
run: |-
set +x
rm -rf ${{ env.MOUNT_DIR }}/*
rm -rf ${{ env.TEMP_DIR }}/*
./cloudfuse.test unmount all
./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/mount_foreg_2.cov mount all ${{ env.MOUNT_DIR }} --config-file=${{ env.cloudfuse_CFG }} --log-level=log_debug --foreground=true &
if [ $? -ne 0 ]; then
exit 1
fi
sleep 5
echo -e "\n\nlogging:\n level:log_debug\n type:base" >> ${{ env.cloudfuse_CFG }}
sed -i 's/timeout:.*/timeout: 300/' ${{ env.cloudfuse_CFG }}
sleep 5
./cloudfuse.test unmount all
- name: 'CLI : Secure Config'
shell: bash {0}
env:
NIGHTLY_STO_ACC_NAME: "${{ secrets.NIGHTLY_STO_BLOB_ACC_NAME }}"
NIGHTLY_STO_ACC_KEY: "${{ secrets.NIGHTLY_STO_BLOB_ACC_KEY }}"
ACCOUNT_TYPE: block
ACCOUNT_ENDPOINT: https://${{ secrets.NIGHTLY_STO_BLOB_ACC_NAME }}.blob.core.windows.net
VERBOSE_LOG: false
USE_HTTP: false
run: "set +x\nrm -rf ${{ env.MOUNT_DIR }}/*\nrm -rf ${{ env.TEMP_DIR }}/*\n./cloudfuse.test unmount all\n./cloudfuse.test gen-test-config --config-file=azure_key.yaml --container-name=${{ matrix.containerName }} --temp-path=${{ env.TEMP_DIR }} --output-file=${{ env.cloudfuse_CFG }}\n\n./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/secure_encrypt.cov secure encrypt --config-file=${{ env.cloudfuse_CFG }} --output-file=${{ runner.workspace }}/cloudfuse.azsec --passphrase=123123123123123123123123 \nif [ $? -ne 0 ]; then\n exit 1\nfi\n./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/mount_secure.cov mount ${{ env.MOUNT_DIR }} --config-file=${{ runner.workspace }}/cloudfuse.azsec --passphrase=123123123123123123123123 &\nsleep 10\nps -aux | grep cloudfuse\nrm -rf ${{ env.MOUNT_DIR }}/*\ncd test/e2e_tests\ngo test -v -timeout=7200s ./... -args -mnt-path=${{ env.MOUNT_DIR }} -adls=false -tmp-path=${{ env.TEMP_DIR }}\ncd -\n\n./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/secure_set.cov secure set --config-file=${{ runner.workspace }}/cloudfuse.azsec --passphrase=123123123123123123123123 --key=logging.level --value=log_debug\n./cloudfuse.test unmount all\nsleep 5"
- name: 'CLI : Health monitor stop pid'
shell: bash {0}
run: |-
set +x
./cloudfuse.test unmount all
sudo kill -9 `pidof cloudfuse.test`
rm -rf ${{ env.MOUNT_DIR }}/*
rm -rf ${{ env.TEMP_DIR }}/*
mkdir -p ${{ env.MOUNT_DIR }}/hmon_test
sudo ln -s `pwd`/cfusemon /usr/local/bin/cfusemon
ls -l /usr/local/bin/cfusemon*
cat /tmp/configAdlsProfilerTemp.yaml
./cloudfuse.test mount ${{ env.MOUNT_DIR }}/hmon_test --config-file=/tmp/configAdlsProfilerTemp.yaml
sleep 10
ps -aux | grep cloudfuse
ps -aux | grep cfusemon
./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/cfusemon_stop_pid.cov health-monitor stop --pid=`pidof cloudfuse`
./cloudfuse.test unmount all
- name: 'CLI : Health monitor stop all'
shell: bash {0}
run: |-
set +x
./cloudfuse.test unmount all
sudo kill -9 `pidof cloudfuse.test`
rm -rf ${{ env.MOUNT_DIR }}/*
rm -rf ${{ env.TEMP_DIR }}/*
mkdir -p ${{ env.MOUNT_DIR }}/hmon_test
cat /tmp/configAdlsProfilerTemp.yaml
./cloudfuse.test mount ${{ env.MOUNT_DIR }}/hmon_test --config-file=/tmp/configAdlsProfilerTemp.yaml
sleep 10
ps -aux | grep cloudfuse
ps -aux | grep cfusemon
./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/cfusemon_stop_all.cov health-monitor stop all
./cloudfuse.test unmount all
- name: Install & Start Proxy
run: |-
sudo apt-get update --fix-missing -y
sudo apt remove mitmproxy -y
sudo apt-get install python3-setuptools -y
sudo apt install python3-pip -y
sudo pip3 install mitmproxy
mitmdump -w proxy_logs.txt &
- name: Configure Proxy
run: |-
sudo mkdir /usr/local/share/ca-certificates/extra
sudo cp ~/.mitmproxy/mitmproxy-ca-cert.cer /usr/local/share/ca-certificates/extra/mitmproxy-ca-cert.crt
sudo update-ca-certificates
export https_proxy="127.0.0.1:8080"
export http_proxy="127.0.0.1:8080"
- name: Create Config File - Block Blob Proxy
env:
NIGHTLY_STO_ACC_NAME: "${{ secrets.NIGHTLY_STO_BLOB_ACC_NAME }}"
NIGHTLY_STO_ACC_KEY: "${{ secrets.NIGHTLY_STO_BLOB_ACC_KEY }}"
ACCOUNT_TYPE: block
ACCOUNT_ENDPOINT: https://${{ secrets.NIGHTLY_STO_BLOB_ACC_NAME }}.blob.core.windows.net
VERBOSE_LOG: false
USE_HTTP: false
run: "./cloudfuse.test gen-test-config --config-file=azure_key_proxy.yaml --container-name=${{ matrix.containerName }} --temp-path=${{ env.TEMP_DIR }} --output-file=${{ env.cloudfuse_CFG }}"
- name: Block Blob Coverage Proxy
run: "rm -rf ${{ env.MOUNT_DIR }}/*\nrm -rf ${{ env.TEMP_DIR }}/*\n./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/cloudfuse_block_proxy.cov mount ${{ env.MOUNT_DIR }} --config-file=${{ env.cloudfuse_CFG }} --disable-compression=true --foreground=true &\nsleep 10\nps -aux | grep cloudfuse\nrm -rf ${{ env.MOUNT_DIR }}/*\ncd test/e2e_tests\ngo test -v -timeout=7200s ./... -args -mnt-path=${{ env.MOUNT_DIR }} -tmp-path=${{ env.TEMP_DIR }}\ncd -\nsudo fusermount -u ${{ env.MOUNT_DIR }} \nsleep 5"
- name: Create Config File - ADLS Proxy
env:
NIGHTLY_STO_ACC_NAME: "${{ secrets.AZTEST_ADLS_ACC_NAME }}"
NIGHTLY_STO_ACC_KEY: "${{ secrets.AZTEST_ADLS_KEY }}"
ACCOUNT_TYPE: adls
ACCOUNT_ENDPOINT: https://${{ secrets.AZTEST_ADLS_ACC_NAME }}.dfs.core.windows.net
VERBOSE_LOG: false
USE_HTTP: false
run: "./cloudfuse.test gen-test-config --config-file=azure_key_proxy.yaml --container-name=${{ matrix.containerName }} --temp-path=${{ env.TEMP_DIR }} --output-file=${{ env.cloudfuse_ADLS_CFG }}"
- name: ADLS Coverage Proxy
run: |-
rm -rf ${{ env.MOUNT_DIR }}/*
rm -rf ${{ env.TEMP_DIR }}/*
./cloudfuse.test -test.v -test.coverprofile=${{ env.WORK_DIR }}/cloudfuse_adls_proxy.cov mount ${{ env.MOUNT_DIR }} --config-file=${{ env.cloudfuse_ADLS_CFG }} --foreground=true &
sleep 10
ps -aux | grep cloudfuse
rm -rf ${{ env.MOUNT_DIR }}/*
cd test/e2e_tests
go test -v -timeout=7200s ./... -args -mnt-path=${{ env.MOUNT_DIR }} -adls=true -tmp-path=${{ env.TEMP_DIR }}
cd -
./cloudfuse.test unmount all
sleep 5
- name: Save coverage report
run: |
echo 'mode: count' > ./cloudfuse_coverage_raw.rpt
tail -q -n +2 ./*.cov >> ./cloudfuse_coverage_raw.rpt
cat ./cloudfuse_coverage_raw.rpt | grep -v mock_component | grep -v base_component | grep -v loopback | grep -v tools | grep -v "common/log" | grep -v "common/exectime" | grep -v "internal/stats_manager" | grep -v "main.go" | grep -v "component/azstorage/azauthmsi.go" > ./cloudfuse_coverage.rpt
go tool cover -func cloudfuse_coverage.rpt > ./cloudfuse_func_cover.rpt
go tool cover -html=./cloudfuse_coverage.rpt -o ./cloudfuse_coverage.html
go tool cover -html=./cloudfuse_ut.cov -o ./cloudfuse_ut.html
cp ./*.rpt ${{ runner.temp }}/
cp ./*.cov ${{ runner.temp }}/
cp ./*.html ${{ runner.temp }}/
- name: Overall coverage check
run: |-
chmod 777 ./test/scripts/coveragecheck.sh
./test/scripts/coveragecheck.sh
- name: File level coverage check
run: "./test/scripts/coveragecheck.sh file"
AccountCleanup-Cleanup:
needs:
- BuildAndTest-Coverage
strategy:
matrix:
go: ['1.20']
job_name: ['linux']
include:
- job_name: linux
os: ubuntu-latest
containerName: 'test-cnt-ubn'
fuselib: libfuse-dev
fuselib2: fuse
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- name: checkout
uses: actions/[email protected]
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
check-latest: true
- run: go version
- name: Install dependency
run: |-
sudo apt-get update --fix-missing -o Dpkg::Options::="--force-confnew"
sudo apt-get install make cmake gcc g++ parallel ${{ matrix.fuselib }} ${{ matrix.fuselib2 }} -y -o Dpkg::Options::="--force-confnew"
- name: Cleanup Blob Storage
run: go test -timeout 120m -v test/accoutcleanup/accountcleanup_test.go
env:
STORAGE_ACCOUNT_NAME: "${{ secrets.NIGHTLY_STO_BLOB_ACC_NAME }}"
STORAGE_ACCOUNT_Key: "${{ secrets.NIGHTLY_STO_BLOB_ACC_KEY }}"
- name: Cleanup Datalake Storage
run: go test -timeout 120m -v test/accoutcleanup/accountcleanup_test.go
env:
STORAGE_ACCOUNT_NAME: "${{ secrets.AZTEST_ADLS_ACC_NAME }}"
STORAGE_ACCOUNT_Key: "${{ secrets.AZTEST_ADLS_KEY }}"