mirror of
				https://github.com/gravitl/netmaker.git
				synced 2025-10-31 16:43:07 +08:00 
			
		
		
		
	* netclient: math.Rand -> crypto.Rand Signed-off-by: John Sahhar <john@gravitl.com> * netclient: math.Rand -> crypto.Rand * add tests Signed-off-by: John Sahhar <john@gravitl.com> * netclient: math.Rand -> crypto.Rand * add test Signed-off-by: John Sahhar <john@gravitl.com>
		
			
				
	
	
		
			23 lines
		
	
	
	
		
			452 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
	
		
			452 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package logic
 | |
| 
 | |
| import "testing"
 | |
| 
 | |
| func Test_genKeyName(t *testing.T) {
 | |
| 	for i := 0; i < 100; i++ {
 | |
| 		kname := genKeyName()
 | |
| 		t.Log(kname)
 | |
| 		if len(kname) != 20 {
 | |
| 			t.Fatalf("improper length of key name, expected 20 got :%d", len(kname))
 | |
| 		}
 | |
| 	}
 | |
| }
 | |
| 
 | |
| func Test_genKey(t *testing.T) {
 | |
| 	for i := 0; i < 100; i++ {
 | |
| 		kname := GenKey()
 | |
| 		t.Log(kname)
 | |
| 		if len(kname) != 16 {
 | |
| 			t.Fatalf("improper length of key name, expected 16 got :%d", len(kname))
 | |
| 		}
 | |
| 	}
 | |
| }
 |