Grant permission for custom role from hook_install programmatically Drupal Version: 8.5.5

Need to assign permission to existing role during module installation:
Am using below code in hook_install:

use Drupal\user\RoleInterface;
use Drupal\user\UserInterface;
function hook_install() {

 $permission = 'test permission';
    $tester_rid = RoleInterface::TESTER;

    if ('tester' == Role::load($tester_rid)) {
      $tester_role-&gt;grantPermission($permission);
      $tester_role-&gt;save();
    }
}


Above grant permission is not working.
I have also tried with 

user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, array(
      'my custom permission',
    ));
user_role_grant_permissions(RoleInterface::TESTER, array(
      'my custom permission',
    ));


Above hook_install is not working.

Pls help
Try this:

use Drupal\user\Entity\Role;

function mymodule_install() {
  $role_object = Role::load('my custom role name');
  $role_object-&gt;grantPermission('my custom permission name');
  $role_object-&gt;save();
}