From 1f0e50649ce9cb000b3ae70b82f99e5cfa3632e4 Mon Sep 17 00:00:00 2001 From: zwwhdls Date: Wed, 1 Mar 2023 13:28:31 +0800 Subject: [PATCH] fix unit test Signed-off-by: zwwhdls --- pkg/ddc/juicefs/data_load_test.go | 100 +++++++++++++++++++++--------- 1 file changed, 72 insertions(+), 28 deletions(-) diff --git a/pkg/ddc/juicefs/data_load_test.go b/pkg/ddc/juicefs/data_load_test.go index 41a53c9e402..1a4b3e6e5b9 100644 --- a/pkg/ddc/juicefs/data_load_test.go +++ b/pkg/ddc/juicefs/data_load_test.go @@ -25,43 +25,87 @@ import ( ) var valuesConfigMapData = ` -fullnameOverride: test-dataset +cacheDirs: + "1": + path: /jfs/cache3:/jfs/cache4 + type: hostPath +configs: + accesskeySecret: jfs-secret + accesskeySecretKey: accesskey + bucket: http://minio.default.svc.cluster.local:9000/minio/test2 + formatCmd: /usr/local/bin/juicefs format --trash-days=0 --access-key=${ACCESS_KEY} + --secret-key=${SECRET_KEY} --storage=minio --bucket=http://minio.default.svc.cluster.local:9000/minio/test2 + ${METAURL} minio + metaurlSecret: jfs-secret + metaurlSecretKey: metaurl + name: minio + secretkeySecret: jfs-secret + secretkeySecretKey: secretkey + storage: minio edition: community -image: juicedata/juicefs-csi-driver -imageTag: v0.11.0 -imagePullPolicy: IfNotPresent -user: 0 -group: 0 fsGroup: 0 +fullnameOverride: jfsdemo fuse: metricsPort: 14001 - prepare: - subPath: /dir1 - name: pics - accesskeySecret: juicefs-secret - secretkeySecret: juicefs-secret - bucket: http://xx.xx.xx.xx/pics - metaurlSecret: juicefs-secret - storage: minio - image: juicedata/juicefs-csi-driver - nodeSelector: - fluid.io/f-fluid-test-dataset: "true" - imageTag: v0.11.0 - mountPath: /runtime-mnt/juicefs/fluid/test-dataset/juicefs-fuse - cacheDir: /tmp/jfs-cache - hostMountPath: /runtime-mnt/juicefs/fluid/test-dataset - command: /bin/mount.juicefs redis://xx.xx.xx.xx:6379/1 /runtime-mnt/juicefs/fluid/test-dataset/juicefs-fuse -o metrics=0.0.0.0:9567,subdir=/dir1,cache-size=4096,free-space-ratio=0.1,cache-dir=/tmp/jfs-cache - statCmd: stat -c %i /runtime-mnt/juicefs/fluid/test-dataset/juicefs-fuse - enabled: true + command: /bin/mount.juicefs ${METAURL} /runtime-mnt/juicefs/default/jfsdemo/juicefs-fuse + -o metrics=0.0.0.0:9567,cache-size=1024,free-space-ratio=0.1,cache-dir=/jfs/cache3:/jfs/cache4 criticalPod: true + enabled: true + hostMountPath: /runtime-mnt/juicefs/default/jfsdemo hostNetwork: true + image: registry.cn-hangzhou.aliyuncs.com/juicefs/juicefs-fuse + imagePullPolicy: IfNotPresent + imageTag: v1.0.0-4.8.0 + mountPath: /runtime-mnt/juicefs/default/jfsdemo/juicefs-fuse + nodeSelector: + fluid.io/f-default-jfsdemo: "true" + privileged: true + resources: {} + statCmd: stat -c %i /runtime-mnt/juicefs/default/jfsdemo/juicefs-fuse + volumeMounts: + - mountPath: /jfs/cache3:/jfs/cache4 + name: cache-dir-1 + volumes: + - hostPath: + path: /jfs/cache3:/jfs/cache4 + type: DirectoryOrCreate + name: cache-dir-1 +group: 0 +image: registry.cn-hangzhou.aliyuncs.com/juicefs/juicefs-fuse +imagePullPolicy: IfNotPresent +imagePullSecrets: null +imageTag: v1.0.0-4.8.0 +owner: + apiVersion: data.fluid.io/v1alpha1 + blockOwnerDeletion: false + controller: true + enabled: true + kind: JuiceFSRuntime + name: jfsdemo + uid: 9ae3312b-d5b6-4a3d-895c-7712bfa7d74e +placement: Exclusive +runtimeIdentity: + name: jfsdemo + namespace: default +source: ${METAURL} +user: 0 worker: metricsPort: 14000 - cacheDir: /tmp/jfs-cache + command: /bin/mount.juicefs ${METAURL} /runtime-mnt/juicefs/default/jfsdemo/juicefs-fuse + -o cache-size=1024,free-space-ratio=0.1,cache-dir=/jfs/cache1:/jfs/cache2,metrics=0.0.0.0:9567 hostNetwork: true -placement: Exclusive - -Events: + mountPath: /runtime-mnt/juicefs/default/jfsdemo/juicefs-fuse + privileged: true + resources: {} + statCmd: stat -c %i /runtime-mnt/juicefs/default/jfsdemo/juicefs-fuse + volumeMounts: + - mountPath: /jfs/cache1:/jfs/cache2 + name: cache-dir-1 + volumes: + - hostPath: + path: /jfs/cache1:/jfs/cache2 + type: DirectoryOrCreate + name: cache-dir-1 ` func TestJuiceFSEngine_CreateDataLoadJob(t *testing.T) {