File tree Expand file tree Collapse file tree 7 files changed +32
-0
lines changed 
chef/site-cookbooks/test-cookbook/recipes Expand file tree Collapse file tree 7 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ .project 
Original file line number Diff line number Diff line change 1+ This is content in a data file!
Original file line number Diff line number Diff line change 1+ [project] 
2+ version  = 1.0.0
3+ name  = demo
4+ 
5+ [spec default] 
6+ run_list  = recipe[test-cookbook::default]
7+ 
8+ [blobs] 
9+ Files =data.dat
Original file line number Diff line number Diff line change 1+ file  "/tmp/chef-text.txt"  do 
2+   content  "This is a test written from chef!" 
3+ end 
Original file line number Diff line number Diff line change 1+ This is a test file!
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ 
3+ jetpack download data.dat /tmp/data.dat
4+ cat /tmp/data.dat >  /tmp/test.txt
Original file line number Diff line number Diff line change 1+ import  unittest 
2+ 
3+ class  TestCluster (unittest .TestCase ):
4+     def  test_chef (self ):
5+         # The chef cookbook writes a file to disk, make sure it's there and has the write content 
6+         with  open ('/tmp/chef-text.txt' , 'r' ) as  f :
7+             self .assertEquals ("This is a test written from chef!" , f .read ())
8+ 
9+     def  test_cluster_init (self ):
10+         # The cluster init downloads a datafile (jetpack download) and then writes it's contents to a file 
11+         # Make usre this is the case 
12+         with  open ('/tmp/test.txt' , 'r' ) as  f :
13+             self .assertEquals ("This is content in a data file!" , f .read ())
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments