[lxc-devel] [lxd/master] use crypto/rand instead of math/rand for testing

tych0 on Github lxc-bot at linuxcontainers.org
Wed Jun 1 23:15:47 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 606 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160601/a0d45bfb/attachment.bin>
-------------- next part --------------
From 92bc40c382bb90a0ac668e571f4868cf564917b8 Mon Sep 17 00:00:00 2001
From: Tycho Andersen <tycho.andersen at canonical.com>
Date: Wed, 1 Jun 2016 23:06:58 +0000
Subject: [PATCH] use crypto/rand instead of math/rand for testing

We don't really need good crypto data here, but the nice math/rand.Read API
wasn't added until go 1.6, and we still test on 1.5, so let's just use this
for now.

Some day in the future we can revert this and have our tests go fast again.

Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
---
 shared/util_test.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/shared/util_test.go b/shared/util_test.go
index 253fcd2..fb94d9f 100644
--- a/shared/util_test.go
+++ b/shared/util_test.go
@@ -4,7 +4,7 @@ import (
 	"bytes"
 	"fmt"
 	"io/ioutil"
-	"math/rand"
+	"crypto/rand"
 	"os"
 	"strings"
 	"testing"


More information about the lxc-devel mailing list