Merge pull request #2103 from Zillode/fix-integration-rename-windows
Fix integration rename windows
This commit is contained in:
@@ -38,7 +38,7 @@
|
|||||||
<gui enabled="true" tls="false">
|
<gui enabled="true" tls="false">
|
||||||
<address>127.0.0.1:8081</address>
|
<address>127.0.0.1:8081</address>
|
||||||
<user>testuser</user>
|
<user>testuser</user>
|
||||||
<password>$2a$10$7tKL5uvLDGn5s2VLPM2yWOK/II45az0mTel8hxAUJDRQN1Tk2QYwu</password>
|
<password>$2a$10$7tKL5uvLDGn5s2VLPM2yWOK/II45az0mTel8hxAUJDRQN1Tk2QYwu</password><!-- password is testpass -->
|
||||||
<apikey>abc123</apikey>
|
<apikey>abc123</apikey>
|
||||||
</gui>
|
</gui>
|
||||||
<options>
|
<options>
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import (
|
|||||||
|
|
||||||
"github.com/syncthing/protocol"
|
"github.com/syncthing/protocol"
|
||||||
"github.com/syncthing/syncthing/internal/config"
|
"github.com/syncthing/syncthing/internal/config"
|
||||||
|
"github.com/syncthing/syncthing/internal/osutil"
|
||||||
"github.com/syncthing/syncthing/internal/rc"
|
"github.com/syncthing/syncthing/internal/rc"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -50,7 +51,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 +118,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 +155,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 {
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import (
|
|||||||
|
|
||||||
"github.com/syncthing/protocol"
|
"github.com/syncthing/protocol"
|
||||||
"github.com/syncthing/syncthing/internal/config"
|
"github.com/syncthing/syncthing/internal/config"
|
||||||
|
"github.com/syncthing/syncthing/internal/osutil"
|
||||||
"github.com/syncthing/syncthing/internal/rc"
|
"github.com/syncthing/syncthing/internal/rc"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -29,7 +30,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 +159,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...")
|
||||||
|
|||||||
Reference in New Issue
Block a user