Commit c82abc33 authored by jiangpeng's avatar jiangpeng

dpos:set umask before create file in unit test

parent fa25ad9c
......@@ -6,6 +6,7 @@ import (
"os"
"strings"
"sync"
"syscall"
"testing"
"time"
......@@ -19,6 +20,8 @@ func init() {
func TestWriteFile(t *testing.T) {
filename := "./tmp_priv_validator.json"
mask := syscall.Umask(0)
defer syscall.Umask(mask)
err := WriteFile(filename, []byte(privValidatorFile), 0664)
require.Nil(t, err)
......@@ -35,6 +38,8 @@ func TestWriteFile(t *testing.T) {
}
func TestWriteFileAtomic(t *testing.T) {
mask := syscall.Umask(0)
defer syscall.Umask(mask)
filename := "./tmp_priv_validator.json"
err := WriteFileAtomic(filename, []byte(privValidatorFile), 0664)
require.Nil(t, err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment