From 9b22b59edfd6ce687b039929901d9035b2be07b4 Mon Sep 17 00:00:00 2001 From: Neeraj Bijalwan Date: Thu, 6 Jan 2022 12:47:53 +0000 Subject: [PATCH] Update run time data in /var/run/icwmpd --- cwmp.c | 6 +++--- inc/backupSession.h | 2 +- inc/notifications.h | 4 ++-- test/script/verify_custom_notifications.sh | 10 +++++----- test/script/verify_download_method.sh | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cwmp.c b/cwmp.c index 4761b28..310394d 100644 --- a/cwmp.c +++ b/cwmp.c @@ -566,9 +566,9 @@ int create_cwmp_var_state_files() else return CWMP_GEN_ERR; } - if (!folder_exists("/var/state/icwmpd")) { - if (mkdir("/var/state/icwmpd", S_IRWXU | S_IRWXG | S_IRWXO) == -1) { - CWMP_LOG(INFO, "Not able to create the folder /var/state/icwmpd"); + if (!folder_exists("/var/run/icwmpd")) { + if (mkdir("/var/run/icwmpd", S_IRWXU | S_IRWXG | S_IRWXO) == -1) { + CWMP_LOG(INFO, "Not able to create the folder /var/run/icwmpd"); return CWMP_GEN_ERR; } } diff --git a/inc/backupSession.h b/inc/backupSession.h index 234bf9c..82c2661 100644 --- a/inc/backupSession.h +++ b/inc/backupSession.h @@ -21,7 +21,7 @@ #define RPC_SEND 1 #define CWMP_BACKUP_SESSION "" -#define CWMP_BKP_FILE "/var/state/icwmpd/.icwmpd_backup_session.xml" +#define CWMP_BKP_FILE "/var/run/icwmpd/icwmpd_backup_session.xml" typedef enum backup_loading { ALL, diff --git a/inc/notifications.h b/inc/notifications.h index d39b904..2629a79 100644 --- a/inc/notifications.h +++ b/inc/notifications.h @@ -48,8 +48,8 @@ extern struct list_head list_param_obj_notify; uci_foreach_element(list_notif, e) { \*/ -#define DM_ENABLED_NOTIFY "/var/state/icwmpd/.dm_enabled_notify" -#define NOTIFY_FILE "/etc/icwmpd/.icwmpd_notify" +#define DM_ENABLED_NOTIFY "/var/run/icwmpd/dm_enabled_notify" +#define NOTIFY_FILE "/etc/icwmpd/icwmpd_notify" void ubus_check_value_change_callback(struct ubus_request *req, int type, struct blob_attr *msg); void cwmp_update_enabled_notify_file(void); int check_value_change(void); diff --git a/test/script/verify_custom_notifications.sh b/test/script/verify_custom_notifications.sh index 4d9257b..98b8aba 100755 --- a/test/script/verify_custom_notifications.sh +++ b/test/script/verify_custom_notifications.sh @@ -38,7 +38,7 @@ if [[ $notif2 != *"Device.WiFi.SSID.1.SSID"* ]]; then exit 1 fi -rm /etc/icwmpd/.icwmpd_notify +rm /etc/icwmpd/icwmpd_notify echo "PASS test valid custom notification json file" @@ -75,7 +75,7 @@ fi echo "PASS test custom notification invalid json file" -rm /etc/icwmpd/.icwmpd_notify +rm /etc/icwmpd/icwmpd_notify # # Test custom notification json file containing forced active notification @@ -110,7 +110,7 @@ fi echo "PASS test custom notification json file containing forced active notification" -rm /etc/icwmpd/.icwmpd_notify +rm /etc/icwmpd/icwmpd_notify # # Test custom notification json file containing invalid parameter path @@ -145,6 +145,6 @@ fi echo "PASS test custom notification json file containing invalid parameter path" -rm /etc/icwmpd/.icwmpd_notify +rm /etc/icwmpd/icwmpd_notify -echo "PASS: $TEST_NAME" \ No newline at end of file +echo "PASS: $TEST_NAME" diff --git a/test/script/verify_download_method.sh b/test/script/verify_download_method.sh index ba8aeac..8583e71 100755 --- a/test/script/verify_download_method.sh +++ b/test/script/verify_download_method.sh @@ -19,7 +19,7 @@ if [ "$status" != "1" ]; then exit 1 fi -rm /etc/icwmpd/.dm_enabled_notify +rm /etc/icwmpd/dm_enabled_notify remove_icwmp_log echo "Restarting icwmpd in order to apply the new firmware" >> ./funl-test-debug.log supervisorctl restart icwmpd >> ./funl-test-debug.log