mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-23 03:18:59 +00:00
Properly rename config files during integration tests (fixes #1769)
This commit is contained in:
parent
b1dd704819
commit
2baf61fda3
@ -50,7 +50,7 @@ func TestAddDeviceWithoutRestart(t *testing.T) {
|
|||||||
|
|
||||||
os.Remove("h4/config.xml.orig")
|
os.Remove("h4/config.xml.orig")
|
||||||
os.Rename("h4/config.xml", "h4/config.xml.orig")
|
os.Rename("h4/config.xml", "h4/config.xml.orig")
|
||||||
defer os.Rename("h4/config.xml.orig", "h4/config.xml")
|
defer osutil.Rename("h4/config.xml.orig", "h4/config.xml")
|
||||||
|
|
||||||
cfg, err := p4.GetConfig()
|
cfg, err := p4.GetConfig()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -117,7 +117,7 @@ func TestFolderWithoutRestart(t *testing.T) {
|
|||||||
|
|
||||||
os.Remove("h1/config.xml.orig")
|
os.Remove("h1/config.xml.orig")
|
||||||
os.Rename("h1/config.xml", "h1/config.xml.orig")
|
os.Rename("h1/config.xml", "h1/config.xml.orig")
|
||||||
defer os.Rename("h1/config.xml.orig", "h1/config.xml")
|
defer osutil.Rename("h1/config.xml.orig", "h1/config.xml")
|
||||||
|
|
||||||
cfg, err := p1.GetConfig()
|
cfg, err := p1.GetConfig()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -154,7 +154,7 @@ func TestFolderWithoutRestart(t *testing.T) {
|
|||||||
|
|
||||||
os.Remove("h4/config.xml.orig")
|
os.Remove("h4/config.xml.orig")
|
||||||
os.Rename("h4/config.xml", "h4/config.xml.orig")
|
os.Rename("h4/config.xml", "h4/config.xml.orig")
|
||||||
defer os.Rename("h4/config.xml.orig", "h4/config.xml")
|
defer osutil.Rename("h4/config.xml.orig", "h4/config.xml")
|
||||||
|
|
||||||
cfg, err = p4.GetConfig()
|
cfg, err = p4.GetConfig()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -29,7 +29,7 @@ func TestOverride(t *testing.T) {
|
|||||||
fld.ReadOnly = true
|
fld.ReadOnly = true
|
||||||
cfg.SetFolder(fld)
|
cfg.SetFolder(fld)
|
||||||
os.Rename("h1/config.xml", "h1/config.xml.orig")
|
os.Rename("h1/config.xml", "h1/config.xml.orig")
|
||||||
defer os.Rename("h1/config.xml.orig", "h1/config.xml")
|
defer osutil.Rename("h1/config.xml.orig", "h1/config.xml")
|
||||||
cfg.Save()
|
cfg.Save()
|
||||||
|
|
||||||
log.Println("Cleaning...")
|
log.Println("Cleaning...")
|
||||||
@ -158,7 +158,7 @@ func TestOverrideIgnores(t *testing.T) {
|
|||||||
fld.ReadOnly = true
|
fld.ReadOnly = true
|
||||||
cfg.SetFolder(fld)
|
cfg.SetFolder(fld)
|
||||||
os.Rename("h1/config.xml", "h1/config.xml.orig")
|
os.Rename("h1/config.xml", "h1/config.xml.orig")
|
||||||
defer os.Rename("h1/config.xml.orig", "h1/config.xml")
|
defer osutil.Rename("h1/config.xml.orig", "h1/config.xml")
|
||||||
cfg.Save()
|
cfg.Save()
|
||||||
|
|
||||||
log.Println("Cleaning...")
|
log.Println("Cleaning...")
|
||||||
|
Loading…
Reference in New Issue
Block a user