File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 1414#  Exit when any command fails
1515set  -e
1616
17+ #  Ignore "lost+found" directories
18+ GLOBIGNORE=" LOST+FOUND:lost+found" 
19+ 
1720#  Load .env if exists
1821if  [[ -f  .env ]];  then 
1922    source  .env
Original file line number Diff line number Diff line change @@ -76,3 +76,32 @@ teardown() {
7676  [ " $status " -eq  0 ]
7777  [ " $normalized_output " ==  " $normalized_expected_output " 
7878}
79+ 
80+ @test " Test getStorageUsed.sh ignores lost+found directory" 
81+   mkdir -p " ${home} /repos/lost+found" 
82+   dd if=/dev/zero of=" ${home} /repos/lost+found/file1" 
83+   
84+   run bash /test/scripts/getStorageUsed.sh
85+ 
86+   #  Expected output should NOT include lost+found
87+   expected_output=' [
88+     { 
89+       "size": 36, 
90+       "name": "repo1" 
91+     }, 
92+     { 
93+       "size": 1160, 
94+       "name": "repo2" 
95+     }, 
96+     { 
97+       "size": 116,  
98+       "name": "repo3" 
99+     } 
100+   ]'  
101+ 
102+   normalized_output=$( echo " $output " |  jq .) 
103+   normalized_expected_output=$( echo " $expected_output " |  jq .) 
104+ 
105+   [ " $status " -eq  0 ]
106+   [ " $normalized_output " ==  " $normalized_expected_output " 
107+ }
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments