faucetsdn / faucetagent

gNMI agent for faucet configuration
5 stars 2 forks source link

Verify config file hash against faucet_config_hash{func,info} #5

Closed lantz closed 5 years ago

lantz commented 5 years ago

Now that FAUCET is reporting the config file hashes via faucet_config_hash_info, we can use that as the primary signal to verify that our configuration has been accepted (and avoid sending it in the first place if the hash is already the same.)

Previously we had to monitor the config reset counter, wait for it to tick over, and then check for config errors.

The agent log currently reports the hash signals that it used, such as:

faucet_config_hash_info={'.../faucetagent/faucet.yaml':
'b2a3e0dd05c22b776482bc241dc1d1f6a4f5a3ed072cc5055e9cbee523c6d186'},
faucet_config_hash_func={'algorithm': 'sha256'})

The travis change tests this against the latest and greatest FAUCET. After the next FAUCET release this should no longer be necessary.

lantz commented 5 years ago

@anarkiwi @gizmoguy This is the version that checks the config file hash and declares victory if it matches the hash reported in faucet_config_hash_info.