@@ -7,6 +7,7 @@ local update_config = assert(loadfile("../files/sbin/openwisp-update-config.lua"
77local write_dir = ' ./update-test/'
88local config_dir = write_dir .. ' etc/config/'
99local openwisp_dir = ' ./openwisp/'
10+ local stored_dir = openwisp_dir .. ' /stored/'
1011local remote_config_dir = openwisp_dir .. ' remote/etc/config'
1112
1213local function string_count (base , pattern )
@@ -38,8 +39,8 @@ TestUpdateConfig = {
3839 os.execute (' echo restore-me > ' .. openwisp_dir .. ' /stored/etc/restore-me' )
3940 os.execute (' echo /etc/restore-me > ' .. openwisp_dir .. ' /modified.list' )
4041 -- this file is stored in the backup
41- os.execute (' mkdir -p ' .. openwisp_dir .. ' etc/config/' )
42- os.execute (" cp ./update/stored_wireless " .. openwisp_dir .. ' /etc/config/wireless' )
42+ os.execute (' mkdir -p ' .. stored_dir .. ' etc/config/' )
43+ os.execute (" cp ./update/stored_wireless " .. stored_dir .. ' /etc/config/wireless' )
4344 end ,
4445 tearDown = function ()
4546 os.execute (' rm -rf ' .. write_dir )
@@ -123,12 +124,12 @@ function TestUpdateConfig.test_update()
123124 luaunit .assertEquals (restoreFile :read (' *all' ), ' restore-me\n ' )
124125 luaunit .assertNil (io.open (openwisp_dir .. ' /stored/etc/restore-me' ))
125126 -- ensure network configuration file is backed up
126- local storedNetworkFile = io.open (openwisp_dir .. ' /etc/config/network' )
127+ local storedNetworkFile = io.open (stored_dir .. ' /etc/config/network' )
127128 luaunit .assertNotNil (storedNetworkFile )
128129 local initialNetworkFile = io.open (' update/network' )
129130 luaunit .assertEquals (storedNetworkFile :read (' *all' ), initialNetworkFile :read (' *all' ))
130131 -- ensure system configuration file is backed up
131- local storedSystemFile = io.open (openwisp_dir .. ' /etc/config/system' )
132+ local storedSystemFile = io.open (stored_dir .. ' /etc/config/system' )
132133 luaunit .assertNotNil (storedSystemFile )
133134 local initialSystemFile = io.open (' update/system' )
134135 luaunit .assertEquals (storedSystemFile :read (' *all' ), initialSystemFile :read (' *all' ))
0 commit comments